Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/silbermm/libmention
A WebMention implementation in Elixir
https://github.com/silbermm/libmention
elixir indieweb webmention
Last synced: 26 days ago
JSON representation
A WebMention implementation in Elixir
- Host: GitHub
- URL: https://github.com/silbermm/libmention
- Owner: silbermm
- License: apache-2.0
- Created: 2023-06-06T00:28:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-09T03:37:15.000Z (10 months ago)
- Last Synced: 2024-11-07T04:44:36.781Z (3 months ago)
- Topics: elixir, indieweb, webmention
- Language: Elixir
- Homepage: https://hexdocs.pm/libmention/readme.html
- Size: 262 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Libmention Logo](assets/libmention.png "libmention")
[![Hex.pm](https://img.shields.io/hexpm/v/libmention?style=flat-square)](https://hexdocs.pm/libmention/readme.html)
A [Webmention](https://www.w3.org/TR/webmention/) implementation for Elixir
[Read the documentation](https://hexdocs.pm/libmention/Libmention.html)
## Goals
* [x] [Send](https://www.w3.org/TR/webmention/#sending-webmentions) WebMentions
* [ ] [Receive](https://www.w3.org/TR/webmention/#receiving-webmentions) Webmentions (in progress)
* [x] Configurable storage, defaulting to `ets`
* [ ] Easy local development and management of WebMentions including:
* [ ] Accept
* [ ] Decline
* [ ] Verify
* [ ] Block
* [x] 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 webmentionWhen using as a supervised system, add the `Libmention.Supervisor` to your supervision tree and configure it for sending.
```elixir
config = [
outgoing: [
storage: Libmention.EtsStorage
]
]
children = [
...,
{Libmention.Supervisor, config}
]
```
> See `Libmention.Supervisor` for a full list of optionsThen to send webmentions for a page or content,
```elixir
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`:
```elixir
def deps do
[
{:libmention, "~> 0.1.4"}
]
end
```