Created
March 31, 2011 06:59
-
-
Save retlet/895938 to your computer and use it in GitHub Desktop.
http://d.hatena.ne.jp/Cherenkov/20080907/p1 リンク切れてたので保存用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name amazon_short_url | |
// @namespace http://cherenkov.vox.com | |
// @include http://www.amazon.co.jp/* | |
// ==/UserScript== | |
(function(){ | |
var asin = document.getElementById('ASIN'); | |
if(asin){ | |
var link = document.createElement('a'); | |
var url = 'http://amazon.jp/dp/'+asin.value; | |
link.setAttribute('href',url); | |
link.appendChild(document.createTextNode(url)); | |
document.body.insertBefore(link,document.body.firstChild); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment