OK, if you have lots of Twitter embeds in your website, I've written an easy(ish) way to replace them with static images & alt text.

github.com/edent/Tweet2Img

Run:
`python tweet2img.py 1234`

And you'll get a ready-to-paste piece of HTML with a data-encoded image.

`<a href="https:/ /twitter.com/edent/status/123"><img src="data:image/webp;base64,Ukl..." width="550" height="439" alt="text from tweet."/></a>`

It also saves the WebP and alt text if you need them.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Terence Eden

Someone complained that an image with decent alt text wasn't accessible.

So now I'm practising Spite-Driven-Development to create a semantic HTML embed.

Doesn't look *totally* accurate - but not bad for a dozen lines of CSS.

Screenshot of an HTML page and source code.
1
4mo
Replies