Readability bookmarklet, modified to close the current tab

In the last few days I’ve made the switch from Instapaper to Readability, mainly because their just-released iOS app is stunning, and comes with some great typefaces. Given that the apps I live in–Reeder (Mac/iPhone), Mr. Reader (iPad) and Tweetbot (iPhone/iPad)–already support the service, switching was painless (though I will miss sorely Instapaper’s folders).

Readability offers both a bookmarklet and a browser extension for saving articles to your queue, but neither of them closes the respective tab/window after you’ve saved the article. I had the same issue with Instapaper’s bookmarklet and described why it bothered me:

[T]he crux of the Instapaper workflow is the bookmarklet that drops your current tab into your Instapaper account. When you click the bookmarklet a small pop-up tells you whether the link has been saved to your account, and then closes (and this all occurs very quickly, which is why Instapaper just works for me). However, the tab you just saved to Instapaper remains open. Huh? The whole point of the service is to save for later things you can’t read now; what purpose is served by having a site open in two places?

I solved the problem in Instapaper, and, after much tinkering, have come up with a similar solution for Readability. When you click on my modified bookmarklet (or invoke it via a keyboard shortcut), the link is saved to your Readability queue and the tab is closed.

To use the bookmarklet, simply drag [this link](javascript:window.baseUrl='https://www.readability.com';window.readabilityToken='YOUR_TOKEN';var%20s=document.createElement('script');s.setAttribute('type','text/javascript');s.setAttribute('charset','UTF-8');s.setAttribute('src',baseUrl+'/bookmarklet/save.js');document.documentElement.appendChild(s);setTimeout('closeTab()',%202000);function%20closeTab(){var%20xwin%20=%20window.open(location.href,%20%22_self%22);xwin.close();}) to your bookmarks bar. Note that the bookmarklet requires a token that’s specific to your account. I’ve replaced my token with YOUR_TOKEN (without quotes). Find that phrase in my bookmarklet and replace it with the token found in the bookmarklet Readability generates for you (look for readabilityToken%3D%27YOUR_TOKEN%27%3B).