Best embed of Twitter tweets with styles, height adjusted, and fallback to archive
Making the embedded tweet the right height
- oembed twitter full height
- twitter embed height postMessage
- twitter embedded tweet set iframe height
A service that successfully works with Twitter to get the height: https://twitframe.com/
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 https://github.com/davidjbradshaw/iframe-resizer “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!
- embed and archive tweets
- nonprofit open source embedding media tweets
- journalism research service embed archive tweets
https://blog.conifer.rhizome.org/2019/11/06/self-hosted-archival-embeds.html
Doing this in Drupal
- drupal 9 media embed tweets
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.
https://drupal-media.gitbooks.io/drupal8-guide/content/modules/media_entity/twitter.html
Purpose
As a user story, the impetus for this functionality: