Early bird prices are coming to an end soon... ⏰ Grab your tickets before January 17

This article was published on March 31, 2011

Twitter just unveiled “Web Intents”: Here’s how to use them.


Twitter just unveiled “Web Intents”: Here’s how to use them.

If you’ve already implemented a Tweet button onto your site, then you’re familiar with the fact that all you can really do with it is have it retweet an article and perhaps suggest that a user follow a specific account. Today, with the implementation of Twitter’s newest tool called Web Intents, your website gets a whole lot more useful.

Web Intents are designed to allow you to have a pretty hefty amount of interaction with a tweet. Instead of just retweeting and following, you can choose to reply, retweet or favorite an individual message, or you can even choose to display a user on your site to be followed.

How To Use Them

Implementing it is extremely simple. You’ll just need to start with a line of JavaScript:

<script type=”text/javascript” src=”http://platform.twitter.com/widgets.js”></script>

After that, each of the actions (Intents) has a different code.

The 💜 of EU tech

The latest rumblings from the EU tech scene, a story from our wise ol' founder Boris, and some questionable AI art. It's free, every week, in your inbox. Sign up now!

Reply:

<a href=”http://twitter.com/intent/tweet?in_reply_to=TWEET ID”></a>

Retweet:

<a href=”http://twitter.com/intent/retweet?tweet_id=TWEET ID”>

Favorite:

<a href=”http://twitter.com/intent/favorite?tweet_id=TWEET ID”>

Follow:

<a href=”http://twitter.com/intent/user?screen_name=USER NAME”>

So how you go about implementing the individual intents can actually be quite compelling. The obvious advantage is that you can have visitors fully interacting with Tweets on your website, without having to authorize any other connections to Twitter. Intents will simply see whether someone is logged in, and then provide the function that you want.

For instance, you could take a screenshot of a specific tweet, then display the image with a link that would allow the visitor to reply to it. It’s a highly customizable option, and there are more thoughts on the best way to use it in the Twitter Dev blog.

It should prove to be a great way to provide more rich content to your site, without having to worry about people clicking away and leaving, just to reply to something that has been said.

Get the TNW newsletter

Get the most important tech news in your inbox each week.

Also tagged with