Embed Mastodon Threads Comments
Posted on 2024-10-30
@jeff@soapbox.hackdefendr.com @conniptions@mastodon.social @EcksDy@techtoots.com @malin@dice.camp
part1
---
I've created an instance of Embed Mastodon Threads at home.gamerplus.org. This is my home server with fiber optic bandwidth. I can rely on robust performance of the program on this server. Here's the link.
https://home.gamerplus.org/Mastodon_Thread_Embed/thread.php?link=https://gamerplus.org/@hairylarry/113371172717103264
So to use Embed Mastodon Threads copy that link and then replace the link with the embed code link for the parent post of your thread. Put that in an iframe in your blog or website and test it.
part2
---
Adjust the height and width of your iframe to fit your page. I used width=600, height =900. The iframes generated by the program have a width of 400 and as much height as it takes. I will make a config.inc file so the width can be adjusted without altering the program code.
I have removed all the gamerplus references in the code and replaced them with variables from the json data. This should work the same on any server that supports embeds.
part3
---
I have tested it quite a bit and it doesn't always work. Some accounts don't give an embed link. Instead you get a text message. It might work on those accounts but the id of the parent post would have to be deduced somehow.
On some accounts I get only the parent post and a link. On some accounts I get the security error.
This seems to be account dependent, not server dependent but it could be either or.
part 4
---
On mastodon.social most accounts give the text message instead of the embed link but I did find one account that gave the embed link and it worked fine.
Most people will want to embed conversations that have one of their posts as a parent. That's how I intend to use it. I will make a Mastodon post that will be used for comments on a blog post. Then I'll embed that on my blog page.
So if it works on the account you're using you're gold.
part 5
---
This is the comment thread for this blog post.
Embed Mastodon Threads Hosted On Gamerplus
https://home.gamerplus.org/permalink.php?fname=Embed_Mastodon_Threads_Hosted_On_Gamerplus.txt
Pretty cool. Thanks for all your help. You are all in the script for my next podcast.
part 6
---
I added a config.inc file for the width of the comments.
I put up a repository at codeberg.
https://codeberg.org/hairylarry/EmbedMastodonThreads
Next on the list is to create another Plain Text Program. A help page to generate the embed code just by pasting your Parent link into a form.
That will be the index file in the directory hosting the Embed Mastodon Threads program enabling turnkey installation of both programs from a zip.
part 7
---
I wrote the index page for Embed Mastodon Threads as a web app that makes the iframe code ready to embed. There are instructions.
After you paste your embed link in you can copy the embed code and view the embed.
I'm happy with it. Very old school.
Please help me test it here.
https://home.gamerplus.org/Embed_Mastodon_Threads/index.php
Let me know if it works for you.
I need to take a break.
Home -
Table Of Contents -
Most Recent -
RSS -
Permalink -
Text