Skip to content

Instantly share code, notes, and snippets.

@SeanHood
Last active April 26, 2019 20:43
Show Gist options
  • Save SeanHood/ffa56df5ccfe7f4ec7f65aad5f67d3dd to your computer and use it in GitHub Desktop.
Save SeanHood/ffa56df5ccfe7f4ec7f65aad5f67d3dd to your computer and use it in GitHub Desktop.
Link Shortening Bookmarklets

Link Shortening Bookmarklets

Amazon and eBay love to use ugly links which aren't nice to share. Here's two bookmarklets to clean up these URLs before copying them.

How to use

Create a bookmark in your browser of choice, copy and paste the below code into the URL part of the bookmark, give it a witty name and save.

Tested with ebay.co.uk, ebay.com, ebay.de, amazon.co.uk, amazon.com in Chrome

eBay

javascript:(function(s){var l = /(.*ebay\..*itm.).*\/(\d+).*/.exec(location); prompt('Short URL', l[1]+l[2])})()

Amazon

javascript:(function(s){var l = /(.*amazon\..*?\/).*(dp\/.*?\/).*/.exec(location); prompt('Short URL', l[1]+l[2])})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment