Adding Mastodon Comments to Your Blog
1–10 of 63 posts
Re: Adding Mastodon Comments to Your Blog
#2I ended up doing something similar, but statically, and searching for discussions dynamically rather than using a single hardcoded thread. Essentially it's a script that searches for recent posts linking to my domain name on Reddit, HN, etc, and then updates a file with the URL of that post and some information about when it was made and how many posts there are. Then there's a Hugo template that converts the data in this file to HTML.
The script runs every few hours using free GitHub runner time, and if it makes a change, it commits it and creates a pull request with the contents so that I can review it. (I could automatically commit straight to the main branch but I like having the manual review just in case.)
I couldn't get it to work for Mastodon because there's not really a public search for Mastodon (for all sorts of reasons), although at some point I want to get it working for Bluesky. I did try hooking it up with Twitter for a while, but that required all sorts of API keys and things that I didn't want to deal with so I gave up. You also need API keys for Reddit, but that was easier to get hold of and manage.
I wrote a post about how I implemented it here: https://jonathan-frere.com/posts/adding-discussions/
Re: Adding Mastodon Comments to Your Blog
#3Re: Adding Mastodon Comments to Your Blog
#4Re: Adding Mastodon Comments to Your Blog
#5Re: Adding Mastodon Comments to Your Blog
#6I'll literally take ads and tracking over it.
Re: Adding Mastodon Comments to Your Blog
#7Re: Adding Mastodon Comments to Your Blog
#8I’m quite happy with the result. It’s simple, minimal, and fast. It does exactly what I need and no more.
Plus, everything is held for my review before being published, so I don’t have to worry about spam, cross-site scripting, or off-topic comments. It’s been a satisfying solution.
Re: Adding Mastodon Comments to Your Blog
#9Re: Adding Mastodon Comments to Your Blog
#10I can't think of something more hostile than requiring an account on a 3rd party, totally unrelated, platform to post a comment on a blog. I'll literally take ads and tracking over it.