A script to generate embeddable tweets

May 5, 2010 08:01 GMT  ·  By

Twitter has launched its embeddable tweet feature that lets you incorporate individual tweets on your site or blog in all their glory. Actually, its creator doesn’t want you to call it a feature, and for good reason, it’s not some official tool coming from Twitter, it’s a relatively simple script created by Robin Sloan, who happens to work for Twitter.

“[W]e decided to take the janky script we’ve been using to generate static HTML tweets for posts (like the one you see here), polish it up a bit, and make it public. And if tweets really are the new quotes, this should come in handy: Blackbird Pie,” Robin Sloan wrote on the Twitter Media blog.

“The origin of the script is both self- and user-centered. Mostly, we just think it’s a pain to take screen grabs of tweets. But of course we also think it’s a much better user experience to have @-mentions, hashtags and the account itself all linked and clickable,” he added.

Blackberry Pie is very straightforward. All you need is the full link to a tweet, you can access it by clicking on the timestamp on any tweet. Then visit the tool’s page, paste the URL in the text box, click “Bake it” and the script will generate a, rather hefty, piece of HTML code for your embedding pleasure.

You can then paste that on the page you want to embed the tweet and it will show up on your page as a stand-alone tweet with all the links and metadata working. The script is smart enough to incorporate some of the styling on your site, like the font, so that it integrates better with the rest of the content.

There are a few caveats at this point. The script is more of a prototype so there are plenty of rough edges. It may not even work at all in some cases so your experience with it may vary. Also, it relies on Twitter supplying the data, so, if there’s a problem on that end, the tweet won’t be available.