Skip to content

Instantly share code, notes, and snippets.

@kurumigi
Created May 12, 2009 07:03
Show Gist options
  • Save kurumigi/110360 to your computer and use it in GitHub Desktop.
Save kurumigi/110360 to your computer and use it in GitHub Desktop.
[GM script]Amazon Short URL Maker
// ==UserScript==
// @name Amazon Short URL Maker
// @namespace http://d.hatena.ne.jp/kurumigi/
// @include http://www.amazon.tld/*
// @include http://amazon.tld/*
// ==/UserScript==
(function() {
if (document.getElementsByName('ASIN').length) {
var shortURL = 'http://'+document.domain+'/dp/'+document.getElementsByName('ASIN')[0].value+'/';
document.getElementById('btAsinTitle').innerHTML = '<a href="'+shortURL+'">'+document.getElementById('btAsinTitle').innerHTML+'</a>'
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment