Skip to content

Latest commit

 

History

History
69 lines (52 loc) · 1.89 KB

README.md

File metadata and controls

69 lines (52 loc) · 1.89 KB

Libmention Logo

Hex.pm

A Webmention implementation for Elixir

Read the documentation

Goals

  • Send WebMentions
  • Receive Webmentions (in progress)
  • Configurable storage, defaulting to ets
  • Easy local development and management of WebMentions including:
    • Accept
    • Decline
    • Verify
    • Block
    • See Sent

Usage

All aspects of the library can be used piecemeal or as a supervised system.

Sending

When using piecemeal, the functions worth exploring are in Libmention.Outgoing:

  • Libmention.Outgoing.parse/1 is used to parse an html document for all unique links. The idea here is to pass in the body of your post/note/comment and determine which urls may need to have a webmention sent.
  • Libmention.Outgoing.discover/2 takes a link, sends a discovery and determines if webmention is supported at that specific link
  • Libmention.Outgoing.send/4 sends a webmention

When using as a supervised system, add the Libmention.Supervisor to your supervision tree and configure it for sending.

config = [
  outgoing: [
    storage: Libmention.EtsStorage
  ]
]
children = [
  ...,
  {Libmention.Supervisor, config}
]

See Libmention.Supervisor for a full list of options

Then to send webmentions for a page or content,

Libmention.Supervisor.send(url, html)

When the process is done,

Receiving

work in progress

Installation

Add libmention to your list of dependencies in mix.exs:

def deps do
  [
    {:libmention, "~> 0.1.4"}
  ]
end