

Add any custom options passed to your site’s macro, or extracted from the current context, as query parameters in the oEmbed request.Ī Tweet ID is preferred over a Tweet’s web URL: components of the URL such as the associated account’s screen_name may change the Tweet ID is unique to the cited content and will remain the same.


Request and store HTML markup for the requested Tweet data by requesting content from the oEmbed API endpoint. Request fallback markup using oEmbedĪn embedded Tweet should provide appropriate context when viewed on its own, before additional enhancements provided by Twitter for the current viewer. Verify macro inputs against a set of known embedded Tweet parameters before passing the option to the Twitter oEmbed endpoint to set author expectations and remove unneeded cruft. You may choose to have a more custom macro to capture additional embedded Tweet options unique to the article display. The simplest macro is a Tweet URL added to your article content. Behind-the-scenes your macro should determine the best content to display in the current rendering environment, such as HTML and JavaScript on a webpage, native views on iOS and Android, or custom elements in AMP or Apple News Format. Choose a light or dark color theme for Tweet text and background and customize the iframe border color by adding new markup to your site templates.Ī macro added to your site’s editing interface abstracts away the detail of embedding Tweets, allowing an author to focus on content. Integrate Twitter widgets, including embedded Tweets, with your site’s color scheme by including HTML ```elements `_ in the section of your webpage.

Sites powered by a CMS or custom software can provide deeper integration with Twitter content through site-level display preferences, content macros for cross-platform publishing, oEmbed fallback content, and JavaScript loaders described in this guide. Embedded Tweet CMS best practices OverviewĪn embedded Tweet adds pieces of the global conversation happening on Twitter to your site, content, and commentary.
