Skip to content

Instantly share code, notes, and snippets.

@qbit
Created September 13, 2012 01:39
Show Gist options
  • Save qbit/3711283 to your computer and use it in GitHub Desktop.
Save qbit/3711283 to your computer and use it in GitHub Desktop.
Xombrero to Instapaper script
/*
* Script to add read-later urls to instapaper from xombrero
*
* - slightly modified version of the "Read Later" button
*
* To use change OMGAWESOME to the key from the "Read Later" button
* source.
*/
var d = document,
secret = 'OMGAWESOME',
z = d.createElement('script'),
b = document.getElementsByTagName( 'head' )[0],
l = d.location;
try{
if( !b ) {
throw(0);
}
var url = [];
url.push( l.protocol );
url.push( '//www.instapaper.com/j/' );
url.push( secret );
url.push( '?u=' );
url.push( encodeURIComponent( l.href ) );
url.push( '&t=' + ( new Date().getTime() ) );
z.setAttribute( 'src', url.join( '' ) );
b.appendChild( z );
}catch(e){
alert('Please wait until the page has loaded.');
alert( e );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment