Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

James Robertson http://www.r0bertson.co.uk

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

instapaper bookmarklet

Assuming you are registered with the new bookmarking service 'instapaper', then you would use the following code which would normally be placed as a link within your web browser's toolbar.

javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,
s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.instapaper.com/b',
l=d.location,e=encodeURIComponent,p='?v=3&u='+e(l.href) +'&t='+e(d.title) +'&s='+e(s),
u=f+p;try{if(!/^(.*\.)?instapaper([^.]*)?$/.test(l.host))throw(0);
iptstbt();}catch(z){a =function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,
width=250,height=150'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);
else a();}void(0)


I'm interested in using similar JavaScript if I ever write my own personal bookmarking service.
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS