ama
code:book.js
javascript:(function(){
// HTMLからvalueを取得
const title = document.getElementById('productTitle').textContent.trim();
let imageurl;
if(document.getElementById('imgTagWrapperId')){
imageurl = document.getElementById('imgTagWrapperId').querySelector('img').src;
}
else{
imageurl = document.getElementById('ebooks-img-canvas').querySelector('img').src;
}
const asin = document.getElementById('ASIN').value;//ASIN番号の処理
const keyword = window.prompt('検索キーワード.', title);
//Amazon
const amazonlink = '📖Kindle(Amazon)(https://www.amazon.co.jp/exec/obidos/ASIN/'+asin+'/room510-22/)';
// 楽天
const rakuten = 'https://hb.afl.rakuten.co.jp/hgc/0420ee27.e275520c.0420ee28.758c15b9/?pc=https%3A%2F%2Fbooks.rakuten.co.jp%2Fsearch%3Fsitem%3D' + encodeURIComponent(keyword);
const rakutenlink = '🛍️楽天Books('+ rakuten + ')';
// honto
const honto = 'https://honto.jp/netstore/search_021_10' + keyword + '.html';
const hontolink = '<a href="//ck.jp.ap.valuecommerce.com/servlet/referral?sid=2680428&pid=889373199&vc_url=' + encodeURIComponent(honto) + '">📑honto</a><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2680428&pid=889373199" height="1" width="1" Border="0">';
// 紀伊国屋
const kinokuniya = 'https://www.kinokuniya.co.jp/disp/CSfDispListPage_001.jsp?qs=true&ptk=01&q=' + keyword;
const kinokuniyalink = '<a href="//ck.jp.ap.valuecommerce.com/servlet/referral?sid=2680428&pid=889373206&vc_url=' + encodeURIComponent(kinokuniya) + '">📚紀伊国屋</a><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2680428&pid=889373206" height="1" width="1" Border="0">';
// BookWalker
const bookwalker = 'https://bookwalker.jp/search/?qcat=&word=' + keyword;
const bookwalkerlink = '<a href="//ck.jp.ap.valuecommerce.com/servlet/referral?sid=2680428&pid=889373205&vc_url=' + encodeURIComponent(bookwalker) + '">📗BOOK☆WALKER</a><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2680428&pid=889373205" height="1" width="1" Border="0">';
const img = '!+title+ '|200(' +imageurl+ ')';
const itemname = '🚚『' +keyword + '』🚚PR';
const text = img + '\n' + itemname + '\n' + amazonlink + '\n'+ rakutenlink +'\n'+ hontolink +'\n'+ kinokuniyalink +'\n'+ bookwalkerlink +'\n'; // 画像とリンクを改行して連結する
document.getElementById('centerCol').innerHTML = '<textarea style="height:500px">'+text+'</textarea>';
})();
code:ob.js
javascript:(function(){
// HTMLからvalueを取得
const imageurl = document.getElementById('imgTagWrapperId').querySelector('img').src;
const title = document.getElementById('productTitle').textContent.trim();
const asin = document.getElementById('ASIN').value;//ASIN番号の処理
const keyword = window.prompt('検索キーワード.', title);
//Amazon
const amazonlink = '📦Amazonで見る(https://www.amazon.co.jp/exec/obidos/ASIN/'+asin+'/room510-22/)';
// 楽天
const rakuten = 'https://hb.afl.rakuten.co.jp/hgc/0420ee27.e275520c.0420ee28.758c15b9/?pc=https%3A%2F%2Fsearch.rakuten.co.jp%2Fsearch%2Fmall%2F' + encodeURIComponent(keyword)+ '%2F-%2Ff.1-p.1-s.1-sf.0-st.A-v.2%3Fx%3D0%26scid%3Daf_ich_link_urltxt%26m%3Dhttp%3A%2F%2Fm.rakuten.co.jp%2F';
const rakutenlink = '🛍️楽天で検索('+ rakuten + ')';
// Yahoo
const yahoo = 'http://search.shopping.yahoo.co.jp/search?p=' + keyword;
const yahoolink = '<a href="//ck.jp.ap.valuecommerce.com/servlet/referral?sid=2680428&pid=886799263&vc_url=' + encodeURIComponent(yahoo) + '">🎉Yahoo&PayPayモール</a><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2680428&pid=886799263" height="1" width="1" Border="0">';
const img = '!+title+ '|200(' +imageurl+ ')';
const itemname = '🚚' +keyword + '🚚PR';
const text = img + '\n' + itemname + '\n' + amazonlink + '\n'+ rakutenlink +'\n'+ yahoolink +'\n'; // 画像とリンクを改行して連結する
document.getElementById('centerCol').innerHTML = '<textarea style="height:500px">'+text+'</textarea>';
})();