AI Powered

Fetching Responses

A few days ago, I wrote on Mastodon about problems with the IndieConnector and brid.gy.

Maurice (@mauricerenck@mastodon.online)
There seems to be something up with the #indieConnector in combination with brid.gy. All webmentions fall back to the type „mention-of" instead of, for example, „like-of". I am pretty sure the webmention source (generated by brid.gy) previo…

There I mentioned that I have long been planning to fetch external replies, likes, and reposts myself. However, this is not as trivial as it seems at first glance.

Unfortunately, I haven't figured out why collecting replies via brid.gy is no longer working as it used to. I can't view the current logs because they end with error messages before a Webmention is sent.

So it is indeed time to tackle this feature and remove it from the upcoming-features list on GitHub. And that's exactly what I am doing.

When posting automatically to Mastodon or Bluesky, the IndieConnector plugin (IC) already saves the URLs to the posts. In the case of Mastodon, you can also manually provide a URL (this will also be available for Bluesky).

These are already good prerequisites for the feature, as IC knows where to look to collect reactions. Mastodon provides three endpoints to access likes, reposts, and replies – wonderful.

There are already a few solutions and descriptions of how to solve this with JavaScript. They work well, but for the plugins, I need (and want) to take the PHP route.

The IC goes through all the URLs, fetches the replies, and then sends a Webmention to itself. Each response has a virtual page with corresponding Microformats. From here, the usual Webmention process takes place. One reason I chose this approach is that this way, I only need to build the fetching mechanism and not open another path to store data, etc.

Unlike the JavaScript solution, I need to remember which reactions I have already processed so that I don't keep sending the same Webmentions and create unnecessary load on the systems. So, I store the last known response ID for each Mastodon endpoint and end the process once that ID is reached.

So far, this is working great.

However, for the past few hours, I've been sitting here wondering why these Webmentions don't want to get through. They are being sent. And as cool as I find this whole technology, debugging asynchronous processes is and remains tricky. I try to cover individual steps with unit tests, but sometimes – like right now – I still find myself staring at the screen confused.

I hope to resolve the issue quickly. Then I would have the complete process for Mastodon ready and only need to build the fetching mechanism for Bluesky (because after fetching, it continues just like it now does with Mastodon).

Update
I used an incorrect (old) URL for my Webmention endpoint and sent all Webmentions into oblivion, which is why they didn't show up in the panel 🤦🏼‍♂️

React on Mastodon

Enter your Mastodon instance. You will then be redirected to the post and can react there.

You can comment on this post from your blog.

This post reacts to webmentions. You can link it from your website and send a webmention. Your contribution will then appear in the comments here. Does your site not support webmentions? Enter the link to your post here:

Write a comment
By submitting your data, you agree that all entered data may be saved and displayed as a comment.
Like, Share, Reply

I'd love to hear from you! Did you enjoy this post? Leave a comment, link your blog post, or react on Mastodon and Bluesky.

Reactions