26 August 2013

A bookmarklet replacement for Buffer

Slowly but surely, Buffer has become a very useful tool for sharing links from all over the web. It’s not necessarily due to a better feature set – after all, they only added custom scheduling a couple of weeks ago – but rather to the large number of services they support: you can post to the major social networks (, , LinkedIn and now Google+ also) and from a wide range of sources: from the web through browser extensions, from mobile apps like Newsify, Reeder and Feedly and programmatically through ifttt. As TweetDeck – unsurprisingly – stopped supporting Facebook after being acquired by Twitter, Buffer remained the best solution for scheduled posting on Facebook.

Recently though I ran into a small problem: the browser bookmarklet I used for adding links to Buffer stopped working. I don’t want to add another extension because uses up enough memory as it is. I tried to reinstall the bookmarklet, but unfortunately it isn’t listed on the page of supported tools anymore. After a while I even contacted their support on Twitter, with little success. So finally I decided to try to build my own version, however simple.

It turned out to be relatively easy: based on the examples proposed for Feedbin, I replaced the address and parameters with those used by Buffer and that was it! To add it to your browser you need to bookmark any page, then edit the bookmark, replacing the title with something like ‘Add to Buffer’ and the page address with the code below.

javascript:void(location.href='https://bufferapp.com/add?url='+encodeURIComponent(location.href)+'&text='+encodeURIComponent(document.title))

Add a bookmarklet for Buffer in the browserOr, if all works well (I haven’t tried this before), you can drag the following link to the bookmarks bar: Buffer link.

The new bookmarklet is far from perfect though: the biggest problem is that the Buffer sharing window can’t be closed, neither from the ‘close’ button, nor does it go away automatically after buffering a status; but you can use the browser’s Back button to return to the page you visited. As far as I could test it, it works in all major browsers.

Amusingly, after building this bookmarklet, I discovered a copy of the old version buried in a folder of bookmarks. I’m not sure if this is the official bookmarklet, because I must have had some reason to move it there; I assume I installed the official one and hid the other. Since it’s based off a script it behaves more like an extension, with the window closing after sharing. The JavaScript code for this one is posted below – and here is a link to install it directly: Buffer (script). On the other hand, since it uses a script, this version may be blocked on secured sites, whereas the first one works everywhere.

javascript:(function(){var a=document.getElementsByTagName('head')[0],b=document.createElement('script');b.type='text/javascript';b.src='http://bufferapp.com/js/bookmarklet.v1.js?'+Math.floor(Math.random()*99999);a.appendChild(b);})();void 0

8 comments:

  1. This is fantastic. By far the easiest way to Buffer. Thanks a million.

    ReplyDelete
  2. This is great, thanks a million.

    ReplyDelete
  3. Thanks for this. Having to install an extension when a simple bookmark would do the job...well this is much beter.

    ReplyDelete
  4. Thanks a lot. Just what I needed for Chromium - the buffer extension can't be installed in that browser.

    ReplyDelete
  5. Awesome, thank you!!

    ReplyDelete
  6. Awesome. For me the first version of the bookmarklet is even better because nothing needs to load in the current page. Because if the page is a https (SSL) one, then all scripts need to be too, making the second version useless!

    ReplyDelete
    Replies
    1. Yes, I am encountering this problem with scripts being blocked on secure pages more often lately. It blocks other bookmarklets too, unfortunately...

      Delete