Sunday, May 23, 2010

Arc90 Readability For The iPad

It's easy (although convoluted) to install bookmarklets on an iPhone or an iPad; all you do is create a new bookmark, edit it, and then paste the JavaScript for the bookmarklet into the bookmark's URL field.

However, you need the source for the bookmarklet to do this in the first place; Arc90's Readability page doesn't give that source. I'm assuming that's an oversight. Here's the code:

javascript: (function () {
readStyle = 'style-newspaper';
readSize = 'size-medium';
readMargin = 'margin-wide';
_readability_script = document.createElement('SCRIPT');
_readability_script.type = 'text/javascript';
_readability_script.src = 'http://lab.arc90.com/experiments/readability/js/readability.js?x=' + (Math.random());
document.getElementsByTagName('head')[0].appendChild(_readability_script);
_readability_css = document.createElement('LINK');
_readability_css.rel = 'stylesheet';
_readability_css.href = 'http://lab.arc90.com/experiments/readability/css/readability.css';
_readability_css.type = 'text/css';
_readability_css.media = 'all';
document.getElementsByTagName('head')[0].appendChild(_readability_css);
_readability_print_css = document.createElement('LINK');
_readability_print_css.rel = 'stylesheet';
_readability_print_css.href = 'http://lab.arc90.com/experiments/readability/css/readability-print.css';
_readability_print_css.media = 'print';
_readability_print_css.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(_readability_print_css);
})();


Bookmark this page, name the bookmark "Readability", then edit the bookmark, and copy-paste this code into the URL field. Boom - it just works.