I could have sworn Mastodon sent Webmentions for URLs in posts. I guess I was wrong.
(I just spent a lot of time adding Webmention functionality to a site because I thought Mastodon sent them. Oops!)
Post
I could have sworn Mastodon sent Webmentions for URLs in posts. I guess I was wrong.
(I just spent a lot of time adding Webmention functionality to a site because I thought Mastodon sent them. Oops!)
@ramsey i use @bsky.brid.gy to accomplish this. It bridges mastodon and bsky to webmentions
@evert @bsky.brid.gy I am bridged, but that doesn’t seem to work, unless I’m doing something wrong.
It turns out there’s no way to even attempt detecting a mention on a Mastodon URL without a headless browser because Mastodon requires JavaScript to load up all the content into the DOM.
@ramsey You can’t use the api?
@michael That’s not how Webmentions work.
@ramsey Ah. I didn’t think of it as alternative to web mention. I thought of it as alternative to web scraping. (I had assumed your message was about attempting to scrape mastodon for mentions of URLs).
Apologies.
@michael I mean, technically, Webmention is just a scraping spec. 😁
@ramsey lol. I have never really looked into it.
I find it pretty cool that mastodon just respects Accepts: application/json headers on pretty much any valid url.
I probably shouldn’t be because that’s kinda the point of the header, but it’s so rare these days that I still think it’s cool.
@michael That’s cool, but without a defined spec, it’s not something that will work across multiple sites. My main complaint here is that Mastodon doesn’t support Webmention, and it can’t even marginally support it since the DOM isn’t populated until JavaScript loads.
@ramsey I don’t really understand web mentions, so we’re probably talking past one another.
But just to pick up on that one point: the JSON is specced.
Here is the Status spec: https://docs.joinmastodon.org/entities/Status/
Again, I’m concious that I’m just plucking a single half sentence out of your post to pick on. Apologies if I’m missing your point entirely!
@michael I could parse it, but since it’s specific only to Mastodon, I’d have to do a multi-stage parse:
1. Fetch the URL, check for Webmention
2. If fails, fetch again with Accept application/json, check that it’s a Mastodon server (how?) and parse according to Mastodon spec
3. If I got JSON, but it’s not a Mastodon server, what do I do?
@kevinmarks.com I’m federating in the other direction through Brid.gy, so I’m not sure it works. I didn’t get a mention posted to my site when I posted a link here.
@ramsey I just googled webmentions and gemini happily lied to my face and mentioned mastodon multiple times
@ramsey I think Snac send webmentions.