Packages
indieweb
0.0.32
0.0.66
0.0.65
0.0.64
0.0.63
0.0.62
0.0.61
0.0.60
0.0.59
0.0.58
0.0.56
0.0.55
0.0.54
0.0.53
0.0.51
0.0.50
0.0.49
0.0.48
0.0.47
0.0.46
0.0.42
0.0.41
0.0.40
0.0.39
0.0.38
0.0.37
0.0.36
0.0.35
0.0.34
0.0.33
0.0.32
0.0.31
0.0.30
0.0.29
0.0.28
0.0.27
0.0.26
0.0.25
0.0.24
0.0.23
0.0.22
0.0.21
0.0.20
0.0.19
0.0.17
0.0.16
0.0.15
0.0.14
0.0.13
0.0.12
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.3
0.0.2
0.0.1
Collection of common IndieWeb utilites like authorship resolution, Webmention, post type discovery and IndieAuth.
Current section
Files
Jump to
Current section
Files
priv/dist/doc/IndieWeb.Webmention.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.19.3">
<title>IndieWeb.Webmention — IndieWeb v0.0.31</title>
<link rel="stylesheet" href="dist/html-399e30b9b028e3059575.css" />
<link rel="canonical" href="https://hexdocs.pm/indieweb/IndieWeb.Webmention.html" />
<script src="dist/sidebar_items-23b3c70799.js"></script>
<script async src="dist/html-399e30b9b028e3059575.js"></script>
</head>
<body data-type="modules">
<script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" aria-hidden="true"></span>
<span class="sr-only">Toggle Sidebar</span>
</button>
<button class="sidebar-button night-mode-toggle">
<span class="icon-theme" aria-hidden="true"></span>
<span class="sr-only">Toggle Theme</span>
</button>
<section class="sidebar">
<a href="https://indieweb.org/" class="sidebar-projectLink">
<div class="sidebar-projectDetails">
<h1 class="sidebar-projectName">
IndieWeb </h1>
<h2 class="sidebar-projectVersion">
v0.0.31
</h2>
</div>
<img src="assets/logo.png" alt="IndieWeb" class="sidebar-projectImage">
</a>
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
</button>
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search" aria-label="Search" autocomplete="off" />
</form>
<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>
<li><a id="modules-list" href="#full-list">Modules</a></li>
</ul>
<div class="gradient"></div>
<ul id="full-list" class="sidebar-fullList"></ul>
</section>
<section class="content">
<div class="content-outer">
<div id="content" class="content-inner">
<h1>
<small class="visible-xs">IndieWeb v0.0.31</small>
IndieWeb.Webmention
<a href="https://git.jacky.wtf/indieweb/elixir" title="View Source" class="view-source" rel="help">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</h1>
<section id="moduledoc">
<p>Handles Webmention interoperability for a site.</p>
</section>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Summary
</h1>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#direct_send!/3">direct_send!(endpoint, target_url, source)</a>
</div>
<div class="summary-synopsis"><p>Sends out a Webmention to the provided <code class="inline">endpoint</code> for <code class="inline">target</code> from <code class="inline">source</code></p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#discover_endpoint/1">discover_endpoint(page_url)</a>
</div>
<div class="summary-synopsis"><p>Finds the Webmention endpoint of the provided URI</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#receive/1">receive(args)</a>
</div>
<div class="summary-synopsis"><p>Parses properties of an incoming Webmention</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#resolve_source_url/1">resolve_source_url(source)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#resolve_target_from_url/1">resolve_target_from_url(target_url)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#send/2">send(target_url, source)</a>
</div>
<div class="summary-synopsis"><p>Sends a Webmention to the provided URI</p>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#url_adapter/0">url_adapter()</a>
</div>
<div class="summary-synopsis"><p>Defines the adpater to use to resolve URI and source content</p>
</div>
</div>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Functions </h1>
<div class="functions-list">
<section class="detail" id="direct_send!/3">
<div class="detail-header">
<a href="#direct_send!/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">direct_send!(endpoint, target_url, source)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Sends out a Webmention to the provided <code class="inline">endpoint</code> for <code class="inline">target</code> from <code class="inline">source</code>.</p>
</section>
</section>
<section class="detail" id="discover_endpoint/1">
<div class="detail-header">
<a href="#discover_endpoint/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">discover_endpoint(page_url)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>discover_endpoint(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>()) :: {:ok, <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>()} | {:error, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()}</pre>
</div>
</div>
<section class="docstring">
<p>Finds the Webmention endpoint of the provided URI.</p>
<p>This employs the <a href="https://www.w3.org/TR/webmention/#sender-discovers-receiver-webmention-endpoint" title="">Webmention endpoint discovery algorithm</a> to find
the proper endpoint to send Webmentions for the URI in question.</p>
<p>TODO: Add User-Agent information (by allowing to pass in header options)</p>
</section>
</section>
<section class="detail" id="receive/1">
<div class="detail-header">
<a href="#receive/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">receive(args)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>receive(<a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>()) :: {:ok, [action: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">atom</a>(), args: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">map</a>()]} | {:error, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()}</pre>
</div>
</div>
<section class="docstring">
<p>Parses properties of an incoming Webmention.</p>
<p>This aims to resolve the target of an incoming Webmention and determine if there's
a valid action to take from it.</p>
</section>
</section>
<section class="detail" id="resolve_source_url/1">
<div class="detail-header">
<a href="#resolve_source_url/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">resolve_source_url(source)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="resolve_target_from_url/1">
<div class="detail-header">
<a href="#resolve_target_from_url/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">resolve_target_from_url(target_url)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="send/2">
<div class="detail-header">
<a href="#send/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">send(target_url, source)</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>send(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()) ::
{:ok, <a href="IndieWeb.Webmention.SendResponse.html#t:t/0">IndieWeb.Webmention.SendResponse.t</a>()} | {:error, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()}</pre>
<pre>send(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()) ::
{:ok, <a href="IndieWeb.Webmention.SendResponse.html#t:t/0">IndieWeb.Webmention.SendResponse.t</a>()} | {:error, <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>()}</pre>
</div>
</div>
<section class="docstring">
<p>Sends a Webmention to the provided URI.</p>
<p>This determines the endpoint to send <a href="https://www.w3.org/TR/webmention" title="">Webmentions</a> to (using <a href="#discover_endpoint/1"><code class="inline">discover_endpoint/1</code></a>) and
sends the request using the HTTP client provided.</p>
</section>
</section>
<section class="detail" id="url_adapter/0">
<div class="detail-header">
<a href="#url_adapter/0" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">url_adapter()</span>
<a href="https://git.jacky.wtf/indieweb/elixir" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
<div class="specs">
<pre>url_adapter() :: <a href="IndieWeb.Webmention.URIAdapter.html#t:t/0">IndieWeb.Webmention.URIAdapter.t</a>()</pre>
</div>
</div>
<section class="docstring">
<p>Defines the adpater to use to resolve URI and source content.</p>
</section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.19.3),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
</footer>
</div>
</div>
</section>
</div>
</body>
</html>