Last active
February 27, 2018 12:10
-
-
Save masaakif/8585e62ea8b0867963fe to your computer and use it in GitHub Desktop.
Amazonに、Open CalilとMediaMarkerとヨドバシ・ドット・コムのリンクを付ける
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 Calil, MediaMarker and Yodobashi.com | |
// @namespace http://gist.github.com/xxxxx | |
// @description Add calil link, MediaMarker and Yodobashi.com link into Amazon book listing | |
// @include http://*.amazon.* | |
// @grant none | |
// ==/UserScript== | |
var DEBUG=true; | |
showLinksOnAmazon(); | |
function showLinksOnAmazon() { | |
var val = document.getElementById("ASIN").value; | |
if (val != '') { | |
var header = parent.document.getElementById('byline') | |
if (header) { | |
var link_c = document.createElement('a'); | |
link_c.setAttribute('href', 'http://calil.jp/book/' + val); | |
link_c.setAttribute('target', '_blank'); | |
link_c.innerHTML = '<span style=\"font-size:90%; background-color:#ffffcc;\">»Open Calil<br></span>'; | |
var link_mm = document.createElement('a'); | |
link_mm.setAttribute('href', 'http://mediamarker.net/u/masaakif/reg?cat=1&asin=' + val ); | |
link_mm.setAttribute('title', 'Register to MediaMarker'); | |
link_mm.setAttribute('target', '_blank'); | |
link_mm.innerHTML = ' <span style=\"font-size:90%; background-color:#ebf2cc;\">»MediaMarkerに登録</span><br>'; | |
var link_yd = document.createElement('a'); | |
link_yd.setAttribute('href', 'http://www.yodobashi.com/ec/category/index.html?cate=&word=' + val); | |
link_yd.setAttribute('title', 'Jump to Yodobashi.com'); | |
link_yd.setAttribute('target', '_blank'); | |
link_yd.innerHTML = ' <span style=\"font-size:90%; background-color:#bbc8e6;\">»ヨドバシ・ドット・コムにJump</span><br>'; | |
header.parentNode.insertBefore(link_c, header); | |
header.parentNode.insertBefore(link_mm, header); | |
header.parentNode.insertBefore(link_yd, header); | |
} | |
} | |
} | |
function debug() { | |
if (typeof DEBUG != 'undefined' && DEBUG) { | |
console.log.apply(this, arguments); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment