Skip to content(if available)orjump to list(if available)

Adding Mastodon Comments to Your Blog

Adding Mastodon Comments to Your Blog

14 comments

·February 23, 2025

MrJohz

This is a nice idea!

I 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/

susam

After spending far too much time integrating third-party comment systems into my website, I finally decided to roll my own in Common Lisp [1].

I’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.

[1] https://github.com/susam/susam.net/blob/main/form.lisp

malicka

Nice write-up! That the “View comments” simply redirects to the source post when JavaScript isn’t available — it feels very natural, more than I’d have expected!

I wanted to do something similar a while back, but while avoiding JavaScript; so I wrote a shell script that outputs fedi/Mastodon threads as HTML. It’s almost certainly less stable than your approach, but it works well enough for my use-case: https://hak.xwx.moe/jadedctrl/fedi2html In action: https://jaded.xwx.moe/lib/haiku-k-esperanto.html?en

lukev

Nice! I'm waiting for (/ thinking of building) something similar for #atproto/Bluesky. You could even use OAuth to allow users to add responses inline, which would then also show up in the Bluesky feed (if you wanted), with a UX pretty similar to Disqus.

Mastodon is great, but the "pick a server" step is a pretty hard filter for most users, who just want to sign up for something.

You'd also get to benefit automatically from Bluesky's blocking/moderation tools.

jszymborski

Great read. I posted some thoughts on the pros and cons of using Mastodon for comments. Overall, it's been a positive experience for my blog.

https://jszym.com/blog/mastodon_blog_comments/

peter2025

[dead]

peter2025

[dead]

fasbiner

Mastadon and the Fediverse overall are extremely user hostile and it's basically an ideological statement of fealty to use Mastadon. For example:

>You click the "reply" button on my page and it takes you straight to my blog post announcement on Mastodon. If you want to reply, you need a Mastodon account and reply from there. As such, the comments on my page are "read only". They are just a view onto the live comments that are on Mastodon.

This is not fit for purpose and the blog title itself is bordering on misleading but is true to the community's ethos. Despite receiving overwhelming negative user feedback on major aspects of the architecture, onboarding experience, and even deliberately obfuscating the fact that any tin-pot admin of any instance can read your private correspondence, the response has been to shoot the messenger. The ActivityPub protocol does not meet the expectations of the overwhelming majority of even devs, much less the average person.

Anyone who has spoken to a lawyer in the US, UK or EU with relevant experience in that area of law about Mastadon is horrified: there's already enough basis to at least initiate criminal prosecution of not just rogue admins or CSAM sharing:(https://www.theverge.com/2023/7/24/23806093/mastodon-csam-st...), but even potentially applicable to Mastadon contributors and people using it out in the wild.

Combined with their tone-deaf attitude and avoidant tendencies, this is a normalization of deviance in the Feynman sense. The fact that it hasn't happened yet does not mean that the laws on the books and the existing case law isn't applicable. All it means is that no one is really motivated to drop the hammer on them yet. This is not uncommon for startups, but usually their plan is to get big enough and have enough cash to reach an agreement or lobby directly to change the law.

Anyone thinking of any kind of serious integration or involvement with Mastadon should take a quick look at possible legal challenges, since Mastadon, by design, has no money, no lobbying power, and no corporate veil to protect individuals.

A few people in the Mastadon community have gotten angry at me for saying this and launched gross personal attacks, but none of them have been lawyers or willing to issue legal counsel with any kind of reassurance.

The above is a mixture of opinion and mutually agreed upon fact and is certainly up for discussion or the addition of new information. Knowing the Mastadon community though, I don't anticipate any serious response other than attempting to hide information unfavorable to them.

This too should be disconcerting.

brenns10

What weird fake information you're posting. Yes, administrators of fediverse servers can read your personal correspondence -- same as Facebook, X, and other social media sites that don't offer federation (unless you opt into some limited e2ee option). But I, as a fediverse admin, have no ability to read (private) correspondence between two others who don't use my instance.

Ultimately it comes down to: you must trust your instance admin. (Just like you must trust Facebook and X and Tiktok and whomever else). As a result, maybe take private conversations somewhere safer, like Signal or a pgp conversation. If you don't trust your instance admin, why did you sign up with your instance?

sitzkrieg

mastodon is a fediverse client

iLoveOncall

I 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.

beej71

I could add a button to swap the comments out for ads and tracking. ;)

To your point, though, I don't expect anyone without an account already to post, but my target audience largely already has such accounts.

spartanatreyu

Mastodon is part of the fediverse, meaning accounts are federated (accounts on services can communicate with other accounts on other services).

You can run your own server, on your own hardware, make your own account, own every step of the stack, and can comment on there.

It's not just 3rd-party login, it's YOUR-party login.

McDutchie

Disqus requires an account on their system, too.