Posting blogs as Mastodon Toots
+Posting blogs as Mastodon Toots
What is better than posting a blog post? Posting about your posting pipeline. I did this previously with Twitter.
-the elephant in the room
+the elephant in the room
mastodon.social does not support any formatting in the status posts. Yes, there are other instances which have patches to enable features such as markdown formatting, but there is no upstream support.
-time to code
+time to code
My website is built using a really simple static site generator I wrote in Python. Therefore, each post is self-contained in a Markdown file with the necessary metadata.
@@ -62,13 +62,13 @@ Therefore, each post is self-contained in a Markdown file with the necessary metI initially planned on having a command line parser and some more flags.
-interacting with mastodon
+interacting with mastodon
I ended up using mastodon.py rather than crafting requests by hand. Each statuspost/toot call returns a statusid that can be then used as an inreplyto parameter.
For the code snippets, seeing that mastodon does not support native formatting, I am resorting to using ray-so.
-reading markdown
+reading markdown
I am using a bunch of regex hacks, and reading the blog post line by line. Because there is no markdown support, I append all the links to the end of the toot. @@ -97,7 +97,7 @@ In this case, I can extract the tags from the front matter.
-code snippet support
+code snippet support
I am running akashrchandran/Rayso-API.
@@ -117,19 +117,19 @@ In this case, I can extract the tags from the front matter.