close
close

first Drop

Com TW NOw News 2024

Replace Twitter Embeds with Semantic HTML – Terence Eden’s Blog
news

Replace Twitter Embeds with Semantic HTML – Terence Eden’s Blog

I logged into Twitter last week with a new account. No followers, no preferences set. The default experience was an endless slurry of racism and porn. I don’t want to use Twitter anymore. Whatever was good has now been drowned in a cesspool of violent filth.

I still have a lot of Tweets embedded on this blog. With WordPress it was easy to paste a link and have it converted to an embed. But I don’t want to send people to a dangerous site.

So here’s a somewhat automated way to replace embedded tweets with beautiful, semantic HTML. You no longer have to worry about Twitter tracking people when they visit your site. It puts all images and avatars inline, so there’s no data leakage. Links go directly instead of through the annoying t.co service. The HTML is semantic, short, and accessible.

The simple Python code is available on GitHub – feedback is welcome!

Here are some examples. You’ll see that all the links work – to external sites, hashtags or mentions. Media loads, emoji work, alt text is included where available and the CSS is about right. The number of likes and replies is shown – but the number of retweets is not always available in the embed API. The number of quotes and bookmarks is not available.

Polls

Which direction?




13835



5584



4597



18469

Embedded images

Can a hacker use YouTube full time? @XRobotsUK says yes (with an asterisk) and tells gory details #HackadayUncon foto.x.com/7h1ozav0wt


Quote Tweets

Whoever buys the domain gu.com is essentially rewriting history.

They can redirect links like these, thus changing the nature of the content being commented on.

The Steele Dossier alleged that the Russian hacking of the DNC was “carried out with the full knowledge and support of Trump and senior members of his campaign.” Trump’s war on the FBI and efforts to obstruct it make sense if he thinks he can prove it. gu.com/p/axa7k/stw



Answers

Working from home is difficult if @virginmedia is going down so hard that even the status page is collapsing.

Time for lunch. foto.x.com/mje6nh38czOops! Something's broken!


Responding to @edent@edent I can definitely see how this can make your day productive. Does this happen often? If so, I’d love to talk to you about a reliable alternative during your lunch break! ☕ PM me to set up a conversation! ^JH

Videos

The poster of the video is embedded, the actual MP4 is still loaded from Twitter’s site.

This is my first time attending a physical event since the pandemic.

#TapOnTwitter hosted by @gerardsans And @coderinheels

Nothing beats a cool live demo.

🤯 pic.x.com/qw1ifom7fh


The simple Python code is available on GitHub – feedback is welcome!


Share this post on…