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 ona 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 isprobably easier than the HPR comment form.
HPR Bot
HPR has a mastodon bot that makes a post when a new show isreleased
The Bot's post and replies can be used as a comment system forHPR
https://botsin.space/@hprEasy
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 repliesExamplehttps://carlschwan.eu/2020/12/29/adding-comments-to-your-static-blog-with-mastodon/
Carl Schwan - KDE developerNeither of these is idealMastodon API
Mastodon has an API that can be used to pull a list of statusupdates.
The comments can be pulled from the API and added to the staticsite.
Proof of concept
HPR site using RSS feeds as the data sourcehttps://gitlab.com/norrist/hprfeed2dbFull episode feedComments feed.HPR Episodes 3637 and 3654https://hpr.norrist.xyz/episodes/HPR3637.htmlhttps://hpr.norrist.xyz/episodes/HPR3654.htmlAdd a new step to pull in the HPR Bot post replies as comments.As a demo https://hpr.norrist.xyz will have mastodon comments onrecent episode pages.
get_mastodon_comments.py
load_comments_from_bot()look for status updates regex"New Episode: hpr(\d+) :: "
get_thread_comments()builds list of descendants - aka commentsupdate_db()loops through list of commentsextracts - author, content, , pubdate, ...inserts into sqlite database along with data from full episode andcomment feeds.
HTML template displays mastodon comments underneath the commentsfrom the comment RSS feed.
Mastodon Comment Moderation
I didn't implement any moderation, but there are a few possible waysto do so
Maintain a list of approved contributors. When anunapproved commenter posts
notify the admin that there are comments by a new commenterskip adding any comments to the database until the commenter isadded to the approve list
Maintain a list of approved commentscomments have unique idAdd approved comment ID to a databaseOnly display approved comments.Going Forward
Even without including mastodon comments on the HPR PageIncrease awareness of HPR on MastodonFollow the HPR bot on mastodon.Tag yourself when one of your shows is posted by the HPR.Add your mastodon account to your HPR profile / show notes.Comment on the HPR bots mastodon post.Links
My mastodon account - https://noc.social/@norristPython to get mastodon comments -https://gitlab.com/norrist/hprfeed2db/-/blob/main/get_mastdon_comments.py
Example page with Mastodon Comments -https://hpr.norrist.xyz/episodes/HPR4126.html
This page may not have any mastodon comments depending on when youcheck the page.
Check a more recent page if there are no mastodon comments.