Wednesday, June 15, 2011

Updated twitter bookmarklet

Recently twitter updated the way you post tweets. So the previous version of bookmarklet stopped working.

So here is the updated version. Just drag this bookmarklet to your bookmarks bar.

Twitter Bookmarklet

Check out his link if you want to know what this bookmarklet does.
Click here

Here is the code:
javascript: var longUrl=document.location; var url = 'http://api.bit.ly/shorten?version=2.0.1&login=tweetthees&apiKey=R_e1266a2cb3177ea0a9e1114cc49d8ad9&longUrl='+longUrl; loadScript(url+'&callback=tweetme'); function loadScript(scriptURL){ var scriptElem = document.createElement('SCRIPT'); scriptElem.setAttribute('language','JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem); } function tweetme(json){ var shortLink=json.results[longUrl].shortUrl; window.location='http://twitter.com/intent/tweet?text=Reading: '+document.title+' '+shortLink }

2 comments: