Quickly send to Twitter the shortened address of the page you are viewing

    image
    After the appearance of simple bookmarklets to get an abbreviated link for the current page (for goo.gl , and for bit.ly ), I realized that a logical continuation should be a bookmarklet for sending this abbreviated link to twitter. As a result, as for me, a very convenient tool was born.



    So, as usual, create a bookmark and paste the following code into its URL:

    javascript:window.bitly_callback=function(response){if(response.errorCode)alert("Error: "+response.errorMessage);else{var text="";if(document.getSelection)text=document.getSelection();else if(document.selection&&document.selection.createRange)text=document.selection.createRange().text; document.location="http://twitter.com/home/?status="+text+" "+response.results[window.location.href].shortCNAMEUrl}};var s=document.createElement("script"); s.src="http://api.bit.ly/shorten?version=2.0.1&longUrl="+encodeURIComponent(window.location.href)+"&login=twshorten&apiKey=R_17f3f726d1661bbebbdcb571489724dc&callback=bitly_callback"; void document.body.appendChild(s);
    


    Now, being on an interesting page, we click on our bookmarklet and automatically go to twitter, and an abbreviated link

    image

    is already inserted in the message field, you only need to add a few words.

    Chip

    if being on an interesting page before clicking on the bookmarklet to select some text,

    image

    it will automatically be added before the link in the message field

    image

    now all you have to do is click the Update button :)

    Also popular now: