Created
July 22, 2012 06:51
-
-
Save bouzuya/3158731 to your computer and use it in GitHub Desktop.
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
javascript: | |
(function(){ | |
var id = 'bouzuya-22'; | |
var pattern = /^http:\/\/www\.amazon\.co\.jp(?:.*)\/(?:(?:gp\/product)|(?:dp))\/([0-9A-Za-z]{10}).*$/; | |
var result = location.href.match(pattern); | |
if (result == null) { | |
return; | |
} | |
var text = document.createTextNode('A!'); | |
var href = 'http://amazon.jp/o/ASIN/' + result[1] + '/' + id; | |
var anchor = document.createElement('a'); | |
anchor.appendChild(text); | |
anchor.setAttribute('href', href); | |
document.getElementById('btAsinTitle').appendChild(anchor); | |
return false; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment