-- Leo's gemini proxy

-- Connecting to ayushnix.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

Generating HTML-only Twitter and Mastodon Posts


There's this thing called oEmbed which advises using iframes to embed content posts. The problem is that on a static website such as this, iframes seem like an abomination. I wanted to retrieve a tweet or a toot in its HTML form and add it to my post.


A few hours of reading API docs of Twitter and Mastodon and writing messy shell script code and here's the result


> "Aha! This is exactly what I was talking about!"

> (Article has nothing to do with what he was talking about)

> Remember folks, random clickbait YouTubers are not a reliable source of technology information. https://t.co/wThF0VdrFt

> — Hector Martin (@marcan42) May 14, 2022


my messy shell script code to post toots from a shell


Here's a toot from mastodon


> Work-in-progress book on Linux kernel internals by 0xAX https://github.com/0xAX/linux-insides/blob/master/SUMMARY.md

> #linux #kernel #linuxkernel

> - BayLibre (@baylibre@fosstodon.org) May 16, 2022


Oh, the script also helps crosspost this post to Mastodon. Maybe I'll add the Twitter and Mastodon icons near the blockquote to showcase the embeds.


All that's left is to somehow add a 'discuss on mastodon' link which points to the crossposted mastodon toot although I'm not sure if that's possible because of the context limitations of Tera templating engine.


EDIT: After receiving a suggestion on Mastodon, I updated the toot generation code to mention the name of the mastodon instance as well. The URL that the date in the toot points to has been updated to point to the actual instance rather than the instance I'm copying links from.


---


Created: 2022-05-16


MicroGemlog

Home

-- Response ended

-- Page fetched on Mon May 20 21:49:23 2024