Amazonの書籍リンクをぶち抜くブックマークレット
from ブックマークレット
Amazonの書籍リンクをぶち抜くブックマークレット
任意のブックマークのURLを以下に差し替えると動くようになるはず
導入
既存のブックマークを右クリック→ 編集を押して
名前:Amazonブックマークレット
URL:一旦消してしたの呪文をコピーして貼り付け。
使い方
Amazonの書籍のページを開いた状態でAmazonブックマークレットをクリック
okが出てくるので押す
code:javascript
javascript:(function(){var c=document.getElementById("productTitle");c||(c=document.getElementById("ebooksProductTitle"));if(c=window.prompt('Scrap "Amazon" to your scrapbox.',c.innerText.trim())){c="\u300e"+c+"\u300f";var b=document.getElementById("ASIN");b?b="ISBN:"+b.value:(b=document.getElementsByName("ASIN.0")0,b="ASIN:"+b.value);var a=document.getElementById("detailBullets_feature_div");a||(a=document.getElementById("product-description-iframe").contentWindow.document.getElementById("productDetailsTable"));(a=a.innerText.match(/(\u51fa\u7248\u793e : .+)(\(.+\))/))?(a1=a1.replace(/:/,":["),a1=a1.match(/;/)?a1.replace(/;/,"];"):a1+"]",a2=a2.replace(/\((\d+\/\d+)\//,"($1/")+" "):a="","","";if(null!=document.getElementById("bookDescription_feature_div")){var d=document.getElementById("bookDescription_feature_div").firstElementChild.firstElementChild;d=d?d.innerText.replace(/\n/g,"\n>"):""}else d="";var e=document.getElementById("imgBlkFront");e||(e=document.getElementById("ebooksImgBlkFront"));e=e.getAttribute("src");var h=[],k=document.getElementsByClassName("author");for(g=0;g<k.length;g++){var f=kg.innerText.replace(/\r?\n/g,"").replace(/,/,""),l=f.match(/\(.+\)/);f=f.replace(/\(.+\)/,"").replace(/ /g,"");h.push(l+" "+f+"")}b=""+e+" "+window.location.href+"\n"+h.join(" ")+"\n"+a1+a2+b+"\n>"+d+"\n#\u66f8\u7c4d\u540d\n";b=encodeURIComponent(b);window.open("https://scrapbox.io/VRC221b/"+encodeURIComponent(c.trim())+"?body="+b)}})();
何が書いてあるのかまったくわからん...きゅ.icon
わたしもわからんまんだこむぎ.icon