Endgame Viable
Sending Webmentions and Pingbacks
Tom 907 words
Another day, another major upgrade to the blog platform.
This time I’ve added support for sending webmentions and pingbacks to external sites referenced in posts.
I think you can probably guess how I did it by now: I used Antigravity to build out the serverless Lambda functions I required, adding onto the previous Bathtub Robot repo which handled sending fediverse notifications.
I asked Antigravity to create a diagram of the architecture:
I hope that renders on my blog. Hugo doesn’t natively support Mermaid diagrams; it supports Goat diagrams, for some reason. (Will it translate to RSS though?) [UPDATE: The answer is no, no it won’t. Oops. Note to self: Future diagrams need to be images.]
In narrative form:
- A
pollerchecks the blog’s JSON feed for updates every 15 minutes. If there’s a new post, an SNS event is dispatched. (It’s the same event that triggers posting a notification to the fediverse.) (Someday I want to work out a way to get my Hugo deployment to trigger notifications when deployment is complete.) - The
link-dispatcherserverless function triggers, which extracts all the external links from the post within the<article>, and sends out SNS events for each link. - Both the
webmention-senderandpingback-senderserverless functions are triggered, which perform the work of discovering the right endpoints and sending webmentions and pingbacks to external sites. (Pingbacks are not sent if the target site supports webmentions.)
I’ve tested the functions as much as I can locally (using localstack), but I won’t actually know if it all works until I publish this post, at which time it will trigger the above chain reaction of serverless functions and SNS events.
I will now embed a link to a WordPress site I own so that if it crashes spectacularly, at least it won’t hurt anybody else. Yikes, I haven’t updated that site since 2018. It’s obsolete now and needs to be destroyed.
I receive webmentions and pingbacks by leveraging webmention.io, a site that I basically never check, so I have no idea if anyone is or has been linking to my blog.
Someday I might wire up something of my own to handle that, but it’s a little more complicated to setup an always-on server to respond to POST requests. Well, not complicated per se… the word I was looking for was expensive.
I could potentially use my Vultr VPS as a webmention receiver, since it’s now running my GoToSocial instance and needs to be always on anyway. Food for thought. An Antigravity project for another day.
One thing I probably won’t do is add a list of pingbacks and webmentions at the bottom of each post page, like WordPress did. (Does it still do that?) I’ll have to find some other way to get notified if and when anyone ever references my site.
I don’t know if I’ve improved much in terms of writing during Blaugust this year, but I’ve made a shocking number of changes to the tech running under my blog’s hood this year, undoubtedly more than I ever have at once before, and that’s worth the price of admission this year for me.
And another thing…
I host this blog entirely within AWS, mainly because a baseline AWS knowledge happens to be useful for my day job. I set Antigravity to work on analyzing my AWS cost breakdown and found several things I was paying for that I no longer need.
My goal has always been to keep the hosting of the blog on AWS as close to $5/month as possible (not counting the domain name renewals). It’s been approaching $8/month for the last year though.
UPDATE: The test worked. A pingback and webmention were both successfully sent from this post.
Leave a Comment
This is a homegrown DIY comment system I've been working on. It works but technically you're beta testing it. Good luck. Go here to enter a comment on this post without Javascript.