Created
February 3, 2016 06:15
-
-
Save Nyoho/6d9da48847d81dd53cbe to your computer and use it in GitHub Desktop.
Amazon.co.jpの書籍情報をコピーするときに便利なブックマークレット
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
javascript:(function()%7Bvar%20a=document.getElementById('booksTitle').innerText;var%20b=document.getElementsByClassName('bucket');for(i=0;i<b.length;i++)if(/登録情報/i.test(b[i].innerHTML))var%20r='■%20'+a+b[i].innerText;r=r.replace(/おすすめ[\s\S]*らせる\n/,'');b=document.getElementsByTagName('b');for(i=0;i<b.length;i++)if(/ISBN-10/i.test(b[i].innerHTML))is=b[i].parentNode.innerHTML.match(/(\d{10})/);var%20e=document.createElement('textarea');e.style.width='100%25';e.value=r+'http://www.amazon.co.jp/dp/'+is[1]+'/\n';document.body.insertBefore(e,document.body.firstChild);e.focus();e.select();e.ondblclick=function()%7Be.parentNode.removeChild(e);%7D;e.oncopy=function()%7BsetTimeout(function()%7Be.parentNode.removeChild(e);%7D,1);return%20true;%7D%7D)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment