Created
March 26, 2012 21:27
-
-
Save retlet/2209860 to your computer and use it in GitHub Desktop.
amazonのURLを短縮するgreasemonkeyスクリプト cf.http://d.hatena.ne.jp/Cherenkov/20080907/p1
This file contains hidden or 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 amazon_short_url | |
// @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
user.jsのリンク切れててインストールめんどうだったので。