Twitter started to mess with embedded content on your site (#note)

The following news is wild!
Twitter changed how its library widgets.js handles deleted Tweets embedded on other sites. I never considered this interesting case. How would one build a UI library for data that’s not available anymore?…


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis

The following news is wild!

Twitter changed how its library widgets.js handles deleted Tweets embedded on other sites. I never considered this interesting case. How would one build a UI library for data that's not available anymore?

I'd have to sleep over this problem, but here's what I wouldn't do, aka the new Twitter way. 🤦‍♂️

Twitter decided that it's reasonable to wipe out embedded Tweet content on millions of sites if the Tweet in question isn't available on their platform anymore. 😲

Kevin Marks shares this discovery in detail on his blog. Here's a quick summary for my archive.

widgets.js behavior so far

If you decide to embed a Tweet and hit the embed button in the Twitter UI, you'll receive a snippet like the following.

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">
   This is worth checking out on GitHub. 👍 <a href="TWEET_RESOURCE">https://t.co/...</a></p> &mdash; Stefan Judis (@stefanjudis) <a href="TWEET_URL">April 9, 2022</a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

You include the content in a blockquote, load Twitter's UI script and when it kicks in, the existing markup and content is enhanced with the usual Twitter look'n'feel.

Progressive enhancement for the win! Sweet!

This approach works great for available Tweets. And if the embedded Tweet was deleted, widgets.js wouldn't do anything. It would leave your fallback content untouched.

It's your content on your site, right?

widgets.js new behavior

The case of Tweet deletion is where Twitter's recent changes come in. If one of your embedded Tweets was deleted, widgets.js will now wipe out the fallback HTML and render an empty shell.

Think this through for a moment; Twitter decided that if the content isn't available on their platform anymore, it shouldn't be on your site either.

Excuse me?

This change is beyond wild. Twitter is now messing with the quotes on millions of pages.

But on the bright side, we can learn one thing from this.

Own your content! You'll never know if a service will be around tomorrow or, in some rare cases, if it decides to mess with your HTML and delete quotes all around the internet.

Let's hope Twitter reverts this change. 🤞 Check Kevin's post if you want to dive deeper into it!


Reply to Stefan


This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis


Print Share Comment Cite Upload Translate Updates
APA

Stefan Judis | Sciencx (2022-04-08T22:00:00+00:00) Twitter started to mess with embedded content on your site (#note). Retrieved from https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/

MLA
" » Twitter started to mess with embedded content on your site (#note)." Stefan Judis | Sciencx - Friday April 8, 2022, https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/
HARVARD
Stefan Judis | Sciencx Friday April 8, 2022 » Twitter started to mess with embedded content on your site (#note)., viewed ,<https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/>
VANCOUVER
Stefan Judis | Sciencx - » Twitter started to mess with embedded content on your site (#note). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/
CHICAGO
" » Twitter started to mess with embedded content on your site (#note)." Stefan Judis | Sciencx - Accessed . https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/
IEEE
" » Twitter started to mess with embedded content on your site (#note)." Stefan Judis | Sciencx [Online]. Available: https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/. [Accessed: ]
rf:citation
» Twitter started to mess with embedded content on your site (#note) | Stefan Judis | Sciencx | https://www.scien.cx/2022/04/08/twitter-started-to-mess-with-embedded-content-on-your-site-note/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.