Tech Note: Embedded Tweets in Comments and Pages

New Twitter integration features
LGF • Views: 29,309

We have some new features to announce, designed to make it much simpler to place embedded tweets from Twitter in comments and LGF Pages.

All you have to do to insert an embedded tweet is paste in the URL of the tweet’s ‘Details’ page at Twitter. For example, here’s the page for my tweet about the previous article.

You get to these individual tweet pages at Twitter by clicking the time/date on any tweet, or by expanding it (by clicking inside it) and then clicking the ‘Details’ link.

When your comment or Page is posted, the URL of the tweet will be automatically transformed by the LGF Blog Engine (through the magic of regular expressions and Twitter’s oEmbed API) into the HTML code that shows the full text of the tweet. This HTML code can then be further transformed into the actual Twitter-formatted embedded tweet, with links for following, replying, retweeting, etc.

Unfortunately, that final step can only happen at page load time; the Twitter API doesn’t have a method of rendering the embedded tweet dynamically yet. This means that if you post a comment through our Ajax system, you won’t see the final Twitter-formatted tweet — but you will see the full text of the tweet with a credit line and links to the author, so it’s still useful. You’ll see the final embedded tweet the next time you reload the entire page.

For LGF Pages authors, there’s another nice feature. When you use the LGF Pages bookmarklet on any Twitter details page, the Pages posting form will open up with the code for the embedded tweet already inserted in the editing box — you don’t even have to copy or paste anything.

Jump to top

Create a PageThis is the LGF Pages posting bookmarklet. To use it, drag this button to your browser's bookmark bar, and title it 'LGF Pages' (or whatever you like). Then browse to a site you want to post, select some text on the page to use for a quote, click the bookmarklet, and the Pages posting window will appear with the title, text, and any embedded video or audio files already filled in, ready to go.
Or... you can just click this button to open the Pages posting window right away.
Last updated: 2023-04-04 11:11 am PDT
LGF User's Guide RSS Feeds

Help support Little Green Footballs!

Subscribe now for ad-free access!Register and sign in to a free LGF account before subscribing, and your ad-free access will be automatically enabled.

Donate with
PayPal
Cash.app
Recent PagesClick to refresh
Once Praised, the Settlement to Help Sickened BP Oil Spill Workers Leaves Most With Nearly Nothing When a deadly explosion destroyed BP’s Deepwater Horizon drilling rig in the Gulf of Mexico, 134 million gallons of crude erupted into the sea over the next three months — and tens of thousands of ordinary people were hired ...
Cheechako
Yesterday
Views: 69 • Comments: 0 • Rating: 0
Texas County at Center of Border Fight Is Overwhelmed by Migrant Deaths EAGLE PASS, Tex. - The undertaker lighted a cigarette and held it between his latex-gloved fingers as he stood over the bloated body bag lying in the bed of his battered pickup truck. The woman had been fished out ...
Cheechako
4 days ago
Views: 169 • Comments: 0 • Rating: 1