Best embed of Twitter tweets with styles, height adjusted, and fallback to archive

Making the embedded tweet the right height

A service that successfully works with Twitter to get the height:

Note that it is necessary to work with Twitter somehow; it is not possible to calculate the height of another website’s page embedded as an iFrame without providing a way for you to get this info. Per the author of “If the other page is on a domain outside your control and you can not add JavaScript to that page, then now is the time to give up all hope of ever getting the iframe to size to the content. As it is impossible to work out the size of the contained page, without using JavaScript on both the parent and child pages.”

Using a local or trusted service copy of the tweet

Either as a fallback or as the main way it is presented, for consistency and no trackers!

Doing this in Drupal

For what it currently does, embedding a tweet as a media entity seems way too heavy— especially since it requires a title being set, which of course has to be automated somehow for this workflow to be remotely bearable.


As a user story, the impetus for this functionality: