Jump to content

Instapaper Text bookmarklet


Recommended Posts

  • 11 months later...

I'm trying to add an Alfred hotkey shortcut for the save to Instapaper bookmarklet. Using your workflow as an example, I can't get it to run. I think it may have something to do with html encoding in the javascript.

 

The bookmarklet is:

javascript:function%20iprl5()%7Bvar%20d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try%7Bif(!b)throw(0);d.title='(Saving...)%20'+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/p2s8OpRKevt0?a=read-later&u='+encodeURIComponent(l.href)+'&t='+(new%20Date().getTime()));b.appendChild(z);%7Dcatch(e)%7Balert('Please%20wait%20until%20the%20page%20has%20loaded.');%7D%7Diprl5();void(0)

And the osascript I'm trying to use for Alfred is:

tell application "Safari" to do JavaScript "javascript:function iprl5(){var d=document,z=d.createElement('scr' 'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...)+'+d.title;z.setAttribute('src',l.protocol '//www.instapaper.com/j/p2s8OpRKevt0?a=read-later&u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime()));b.appendChild(z);}catch(e){alert('Please wait until the page has loaded.');}}iprl5();void(0)" in the current tab of the front window

I decoded the html with an online app, then replaced spaces with "+" in the places I thought were required. I'm unfamiliar with this stuff, though.

 

Any ideas on making this work?

Link to comment

I managed to do it with the javascript code from http://www.instapaper.com/save

 

Here is the code I got:

tell application "Safari" to do JavaScript "javascript:function iprl5(){var d=document,z=d.createElement('scr'+'ipt'),b=d.body,l=d.location;try{if(!b)throw(0);d.title='(Saving...) '+d.title;z.setAttribute('src',l.protocol+'//www.instapaper.com/j/4Vifm0CMV6m8?a=read-later&u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime()));b.appendChild(z);}catch(e){alert('Please wait until the page has loaded.');}}iprl5();void(0)" in the current tab of the front window

And here is the updated workflow.

Link to comment
  • 2 months later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...