Created
September 13, 2012 01:39
-
-
Save qbit/3711283 to your computer and use it in GitHub Desktop.
Xombrero to Instapaper script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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