Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Created October 24, 2013 07:38
Show Gist options
  • Save hackugyo/7132845 to your computer and use it in GitHub Desktop.
Save hackugyo/7132845 to your computer and use it in GitHub Desktop.
javascript:
(function(){
if(document.URL.indexOf('amazon.co.jp') == -1){
prompt('コピーしてください','`'+document.title+'%20'+'<'+document.URL+'>`_');
}
else {
var title = document.getElementById('btAsinTitle').textContent;
var b = document.getElementsByTagName('b');
var r;
for(i=0;i<b.length;i++)if(/ISBN-13/i.test(b[i].innerHTML))r=b[i].parentNode.innerHTML.match(/(\d{3})-(\d+)/);
var isbn = r[1]+r[2];
prompt('Amazon Hatena mode','isbn:'+isbn+':detail:small'+'%20"'+title+'"');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment