Jump to content
JolinM

Instapaper Text bookmarklet

Recommended Posts

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?

Share this post


Link to post

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.

Share this post


Link to post

Ah, thanks! Once I changed your Instapaper user id to mine, worked great. It was just a matter of a couple mixed up plus signs and spaces.

Share this post


Link to post

I'm unable to make this work in Brave – would there be a quick fix for adjusting the Chrome code? Thanks!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...