Skip to content

Instantly share code, notes, and snippets.

@ramn
Created October 3, 2011 19:32
Show Gist options
  • Save ramn/1260004 to your computer and use it in GitHub Desktop.
Save ramn/1260004 to your computer and use it in GitHub Desktop.
Pinboard save bookmarklet, stripping utm_*
javascript:(function(){q=location.href.replace(/utm_source=[^&]+&?|utm_medium=[^&]+&?|utm_campaign=[^&]+&?|utm_content=[^&]+&?/g, "").replace(/[?&]+$/, "");if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;full_url='https://pinboard.in/add?url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p); a=function(){if(!window.open(full_url))location.href=full_url};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment