IndieWeb.Webmention (IndieWeb v0.0.66) View Source
General facilities around Webmentions.
This module provides methods around handling receiving and sending Webmentions.
Link to this section Summary
Functions
Explicitly sends a Webmention.
Finds the Webmention endpoint of the provided URI.
Parses properties of an incoming Webmention.
Generates a source URL for the provided resource.
Determines the resource from the provided target URI.
Sends a Webmention to the provided URI.
Defines the adpater to use to resolve URI and source content.
Link to this section Functions
Specs
direct_send!(binary(), binary(), binary(), keyword()) :: {:ok, IndieWeb.Webmention.SendResponse.t()} | {:error, atom(), keyword()}
Explicitly sends a Webmention.
Sends a Webmention to the provided endpoint
for target
from source
.
Specs
Finds the Webmention endpoint of the provided URI.
This employs the Webmention endpoint discovery algorithm to find the proper endpoint to send Webmentions for the URI in question.
TODO: Add User-Agent information (by allowing to pass in header options) TODO: This hits every endpoint with a HEAD when it's called - need to cache the value. NOTE: This makes an assumption that the endpoint is self-hosted by default. NOTE: This assumes that a site can only have one Webmention endpoint.
Specs
receive(map()) :: {:ok, IndieWeb.Webmention.ReceiveResponse.t()} | {:error, :webmention_receive_failure, [{:reason, any()}]}
Parses properties of an incoming Webmention.
This aims to resolve the target of an incoming Webmention and determine if there's a valid action to take from it.
Specs
Generates a source URL for the provided resource.
Specs
Determines the resource from the provided target URI.
Specs
send(binary(), binary(), map()) :: {:ok, IndieWeb.Webmention.SendResponse.t()} | {:error, :webmention_send_failure, [{:reason, any()}]}
Sends a Webmention to the provided URI.
This determines the endpoint to send Webmentions to (using discover_endpoint/1
) and
sends the request using the HTTP client provided.
Specs
url_adapter() :: IndieWeb.Webmention.URIAdapter.t()
Defines the adpater to use to resolve URI and source content.