Not a huge fan of webmentions (as well as its distant ancestor, pingbacks) but it's nice to see someone doing the work of attempting to make them usable. This is in contrast to the rest of the indieweb, where an interested adopter is kinda left on their own to figure how to wire everything together.
I'm not a huge fan either. I got them working on my blog, but not easily! I'm not a dev at all, and I wouldn't recommend them to anyone who doesn't like tinkering and visiting other blogs to see how they're implemented. The microformats stuff and how to nest them together to work nicely was not easy at all.
The semantic elements part is indeed cumbersome - and the Microformats2 is so flexible (and constantly WIP) that being 100% compliant with all the implementations (like media, locations, events, nested comments...) is very hard. But a basic implementation where at least the URL, author info, title and summary are extracted isn't very hard.
I agree however that even that is cognitive burden that shouldn't be on the blog admin. The library for now focuses on removing most of the burden on the backend side, while providing an example Webmention-compliant article implementation and a Jinja template as examples. But I agree that barriers can lowered on that side too. A handler.render_template(webmention) utility method with a default implementation is probably more than enough in 95% of the cases. And semantic elements in a page can probably be inferred by the library with a bit of static DOM analysis and the right classes attached to it on the fly. Both the tasks (with a priority on the render_template API) are on the backlog :)
Pingbacks were a massive spam vector back in the day. There are provisions for reviewing webmentions in the linked code, but it's still nothing I want to deal with.
(I don't have comments anymore either)
In general, I feel the Indieweb is trying to cargo-cult a better internet by continuing the failed promises of Web 2.0. It's not a solution to the social media silos that scales well.
It's batteries-included in the sense that it's low friction for Indieweb developers, but not so much if you're only interested in creating HTML and CSS.
The minimal example is 60 lines of Python, and that's only if you're using Flask/FastAPI already. If not, you still need to write your own handler and host the app somewhere.
Something like Webmention.io is a lot easier to use for non-developers, imo. Without writing any code (other than the <link>), you get an RSS feed, webhooks, and a host.
This library is still pretty slick, I'd definitely use it if my site ran on Flask.
A minimal example (at least on the Python side) if you use the FastAPI/Flask + SQLAlchemy backend + static file watcher is actually much smaller:
import os
from fastapi import FastAPI
from webmentions import WebmentionsHandler
from webmentions.storage.adapters.db import init_db_storage
from webmentions.server.adapters.fastapi import bind_webmentions
from webmentions.storage.adapters.file import FileSystemMonitor
base_url = "https://example.com"
static_dir = "/srv/html/articles"
def path_to_url(path: str) -> str:
return "" # Something that converts your static file to a URL path
app = FastAPI()
# ...app init...
handler = WebmentionsHandler(
storage=init_db_storage(engine="sqlite:////tmp/webmentions.db"),
base_url=base_url,
)
bind_webmentions(app, handler)
with FileSystemMonitor(
root_dir=static_dir,
handler=handler,
file_to_url_mapper=path_to_url,
) as monitor:
app.run(...)
Any variation on this paradigm of course requires a bit more code (at least implement an endpoint that wraps processing_incoming_webmention and a Link response header), but I've tried to strike a balance here between customization and speed-to-hello-world. And given the extensible nature of objects like storages, handlers and servers binders nothing prevents from adding more adapters :)
The HTML rendering is indeed still missing in the library (but a reference Jinja template is provided under examples), but it's on its way. A handler.render_webmention hook makes sense - even if it means being opinionated about using Jinja, and letting any other templating solution manually adapt the example.
webmentions.io is great for quick mentions btw, but it's quite centralized in nature, which defeats the whole purpose of decentralization behind ideas like these.
webmentions.io is great for quick mentions btw, but it's quite centralized in nature, which defeats the whole purpose of decentralization behind ideas like these.
It's batteries-included in the sense that it's low friction for Indieweb developers, but not so much if you're only interested in creating HTML and CSS.
It's a bit of a pity that webmentions as a protocol are a bit too dynamic-biased: for full-pre-vetting case, it would be so nice to have a fully static site with access to a typical server access log, and run a mention-extraction tool on the log to look at 404 POSTs under a specific path prefix to get a bunch of mentioned-from HTML snippets, or just a list of mentioned-from URLs.
I mean something like POST to «/mentions/local-page-id/urlencoded-message/https/mentioning-site.domain/blog/cool-links-around-web.html» getting extracted as https://mentioning-site.domain/blog/cool-links-around-web.html and then maybe that page has something extractable in microformats or «link rel=». But I wouldn't need to trust people not to spam, or to think about the deployment of webmentions target. And at the same time people who want, would be able to apply a mention-sending tool on their static site local copy, and inform the link targets who have declared interest in such information.
At the current state they're niche and high-friction enough that the spam situation seems to be practically negligible.
But of course, like all nice things that become easier to use and more popular, I see a thousand ways that these can be abused.
The library tries to be pretty much agnostic about moderation. You can override initial_mention_status to PENDING and then attach custom callbacks when a mention update is received. Then you can apply either automatic filtering or trigger manual verification.
gerikson | 8 hours ago
Not a huge fan of webmentions (as well as its distant ancestor, pingbacks) but it's nice to see someone doing the work of attempting to make them usable. This is in contrast to the rest of the indieweb, where an interested adopter is kinda left on their own to figure how to wire everything together.
bbbhltz | 6 hours ago
I'm not a huge fan either. I got them working on my blog, but not easily! I'm not a dev at all, and I wouldn't recommend them to anyone who doesn't like tinkering and visiting other blogs to see how they're implemented. The microformats stuff and how to nest them together to work nicely was not easy at all.
[OP] blacklight | 5 hours ago
The semantic elements part is indeed cumbersome - and the Microformats2 is so flexible (and constantly WIP) that being 100% compliant with all the implementations (like media, locations, events, nested comments...) is very hard. But a basic implementation where at least the URL, author info, title and summary are extracted isn't very hard.
I agree however that even that is cognitive burden that shouldn't be on the blog admin. The library for now focuses on removing most of the burden on the backend side, while providing an example Webmention-compliant article implementation and a Jinja template as examples. But I agree that barriers can lowered on that side too. A
handler.render_template(webmention)utility method with a default implementation is probably more than enough in 95% of the cases. And semantic elements in a page can probably be inferred by the library with a bit of static DOM analysis and the right classes attached to it on the fly. Both the tasks (with a priority on the render_template API) are on the backlog :)siddhartha_golu | 8 hours ago
I'd be interested to know why are you not a fan of webmentions? In theory, it sounds like a decent protocol.
gerikson | 2 hours ago
Pingbacks were a massive spam vector back in the day. There are provisions for reviewing webmentions in the linked code, but it's still nothing I want to deal with.
(I don't have comments anymore either)
In general, I feel the Indieweb is trying to cargo-cult a better internet by continuing the failed promises of Web 2.0. It's not a solution to the social media silos that scales well.
kitkat | 7 hours ago
It's batteries-included in the sense that it's low friction for Indieweb developers, but not so much if you're only interested in creating HTML and CSS.
The minimal example is 60 lines of Python, and that's only if you're using Flask/FastAPI already. If not, you still need to write your own handler and host the app somewhere.
Something like Webmention.io is a lot easier to use for non-developers, imo. Without writing any code (other than the
<link>), you get an RSS feed, webhooks, and a host.This library is still pretty slick, I'd definitely use it if my site ran on Flask.
[OP] blacklight | 7 hours ago
A minimal example (at least on the Python side) if you use the FastAPI/Flask + SQLAlchemy backend + static file watcher is actually much smaller:
Any variation on this paradigm of course requires a bit more code (at least implement an endpoint that wraps
processing_incoming_webmentionand aLinkresponse header), but I've tried to strike a balance here between customization and speed-to-hello-world. And given the extensible nature of objects like storages, handlers and servers binders nothing prevents from adding more adapters :)The HTML rendering is indeed still missing in the library (but a reference Jinja template is provided under
examples), but it's on its way. Ahandler.render_webmentionhook makes sense - even if it means being opinionated about using Jinja, and letting any other templating solution manually adapt the example.webmentions.io is great for quick mentions btw, but it's quite centralized in nature, which defeats the whole purpose of decentralization behind ideas like these.
kitkat | 6 hours ago
That's pretty clean, I like it.
Fair!
k749gtnc9l3w | 3 hours ago
It's a bit of a pity that webmentions as a protocol are a bit too dynamic-biased: for full-pre-vetting case, it would be so nice to have a fully static site with access to a typical server access log, and run a mention-extraction tool on the log to look at 404 POSTs under a specific path prefix to get a bunch of mentioned-from HTML snippets, or just a list of mentioned-from URLs.
I mean something like POST to «/mentions/local-page-id/urlencoded-message/https/mentioning-site.domain/blog/cool-links-around-web.html» getting extracted as https://mentioning-site.domain/blog/cool-links-around-web.html and then maybe that page has something extractable in microformats or «link rel=». But I wouldn't need to trust people not to spam, or to think about the deployment of webmentions target. And at the same time people who want, would be able to apply a mention-sending tool on their static site local copy, and inform the link targets who have declared interest in such information.
fanf | 4 hours ago
What is the spam situation with webmentions? Is there much spam? Is manual moderation sensible?
[OP] blacklight | 2 hours ago
At the current state they're niche and high-friction enough that the spam situation seems to be practically negligible.
But of course, like all nice things that become easier to use and more popular, I see a thousand ways that these can be abused.
The library tries to be pretty much agnostic about moderation. You can override
initial_mention_statustoPENDINGand then attach custom callbacks when a mention update is received. Then you can apply either automatic filtering or trigger manual verification.