Amazonの本のページをScrapboxに送るブックマークレット
code:js
javascript:(()=>{let t=document.querySelector('#productTitle')?.innerText.trim()||"No Title",a=((document.querySelector('.contributorNameID, .author .a-link-normal')||document.querySelector('.author'))?.innerText.trim()||"Unknown").replace(/\s+/g,""),i=document.querySelector('#imgBlkFront, #ebooksImgBlkFront, .imgTagWrapper img')?.src||"",u=location.href,aff=u+"?tag={your_id}",p=encodeURIComponent(t),b=encodeURIComponent([Amazon ${aff}]\n[${i}]\n#books\n#${a}),proj="{your_projectname}",url=https://scrapbox.io/${proj}/${p}?body=${b};window.open(url,"_blank");})();
Amazon アフィリエイトリンク
書影URL
#books
#著者名(空白削除)
このような表示になります。your_id your_projectname を適宜変更してください。