Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

hpr4133 :: Mastodon as a way to comment to HPR episodes

norrist discusses commenting on the hpr mastodon bot's post

<< First, < Previous, , Latest >>

Hosted by norrist on 2024-06-05 is flagged as Clean and is released under a CC-BY-SA license.
python, mastodon, hpr. 3.

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:19:40


Mastodon as a way to comment to HPR episodes

Prompted by Knightwise

  • I should be easier for listeners to discuss shows.
  • There have been several times I have intended to leave a comment on a show, but I forget by the time I get back to my PC
  • Mastodon is made for community interaction.
  • If you are active on mastodon, replying to a mastodon post is probably easier than the HPR comment form.


  • HPR has a mastodon bot that makes a post when a new show is released
  • The Bot's post and replies can be used as a comment system for HPR

Easy Methods to including Mastodon on a static page

  • Each post has an embed link, but it does not include replies.
  • JavaScript can be used to display the post and replies
    • Example
    • Carl Schwan - KDE developer
  • Neither of these is ideal

Mastodon API

  • Mastodon has an API that can be used to pull a list of status updates.
  • The comments can be pulled from the API and added to the static site.

Proof of concept

  • HPR site using RSS feeds as the data source
    • Full episode feed
    • Comments feed.
    • HPR Episodes 3637 and 3654
  • Add a new step to pull in the HPR Bot post replies as comments.
  • As a demo will have mastodon comments on recent episode pages.

  • load_comments_from_bot()
    • look for status updates regex "New Episode: hpr(\d+) :: "
  • get_thread_comments()
    • builds list of descendants - aka comments
  • update_db()
    • loops through list of comments
    • extracts - author, content, , pubdate, ...
    • inserts into sqlite database along with data from full episode and comment feeds.
  • HTML template displays mastodon comments underneath the comments from the comment RSS feed.

Mastodon Comment Moderation

  • I didn't implement any moderation, but there are a few possible ways to do so
    1. Maintain a list of approved contributors. When an unapproved commenter posts
      • notify the admin that there are comments by a new commenter
      • skip adding any comments to the database until the commenter is added to the approve list
    2. Maintain a list of approved comments
      • comments have unique id
      • Add approved comment ID to a database
      • Only display approved comments.

Going Forward

  • Even without including mastodon comments on the HPR Page
  • Increase awareness of HPR on Mastodon
    1. Follow the HPR bot on mastodon.
    2. Tag yourself when one of your shows is posted by the HPR.
    3. Add your mastodon account to your HPR profile / show notes.
    4. Comment on the HPR bots mastodon post.
  • My mastodon account -
  • Python to get mastodon comments -
  • Example page with Mastodon Comments -
    • This page may not have any mastodon comments depending on when you check the page.
    • Check a more recent page if there are no mastodon comments.


Subscribe to the comments RSS feed.

Comment #1 posted on 2024-06-05 14:20:30 by Henrik Hemrin

Comment via phone and laptop/desktop

I mostly listen to HPR with AntennaPod on my phone. I mostly comment on my laptop/dedktop. I am almost daily on Mastodon, from my laptop/desktop. I dislike to write and read on phone, I ptefer a real keyboard and big screen. However, this particulat comment: I listen on AntennaPod on phone, in AntennaPod I click on Open web page, Firefox starts and opens the page for this episode and I type. I don't think it would be much easier to give it on Mastodon. Having said that, each person has its tools and way of working. And I agree Mastodon is good to tell about and promote HPR or specific episodes. And I don't mind if comments on web page and Mastodon will sync (but longer comments will be truncated on Mastodon).
Comment #2 posted on 2024-06-05 17:06:24 by fullstopslash

mastodon comments

I absolutely love this idea! Mastodon is a way people naturally have conversations about a topic anyway, and it'd be a pretty neat option in my opinion! All the options for mastodon clients out there make it an easy platform for me to get updates in whatever form I like! This would be super cool!
Comment #3 posted on 2024-06-05 18:10:27 by Ken Fallon

Some issues

Hi norrist Great idea and I like the solution, but as with most things on HPR, it is rarely a technological quick fix. First how will spam be managed ? This needs to be rock solid as we get hammered constantly. Some instances do not appreciate people taking their posts and putting them on other platforms. How do we know the approve and how do we track that their consent has not changed ? How can we incorporate the feedback with "the show" so that the entire context is maintained ? Can we check them into git, or add them to the database ? How do we remove them if we are required to do so ? Can we include them in the Community News and not violate the Creative Commons license ? Which moderation rules will apply ? How will it stand up to attacks ? Will the character set be comparable ? Not saying it can't be done but there is a lot to consider.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Anti Spam Question: What does the P in HPR stand for ?