(紀)新宿本店在庫検索
by
worris
2010-08-21 [2010/08/21 23:45:50]
Amazonで開いている書籍、またはどのページでも選択した文字列をタイトルとして紀伊國屋書店の店頭在庫検索で探します。コード内のG2=新宿本店です。
-
/*
* @title (紀)新宿本店在庫検索
* @description Amazonで開いている書籍、またはどのページでも選択した文字列をタイトルとして紀伊國屋書店の店頭在庫検索で探します。コード内のG2=新宿本店です。
* @include http://*
* @license MIT License
* @require
*/
(function(){
var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f=d.createElement('form'),asin=d.getElementById('ASIN'),tenpo='G2';
if(asin){
location.href='http://bookweb.kinokuniya.co.jp/hb/ws_search.cgi?KCD='+tenpo+'&W-ISBN='+asin.value;
}else{
f.setAttribute('action','http://bookweb.kinokuniya.co.jp/hb/ws_search.cgi');
f.setAttribute('accept-charset','shift_jis');
var kcd=d.createElement('input');
kcd.setAttribute('name','KCD');
kcd.setAttribute('value',tenpo);
f.appendChild(kcd);
var title=d.createElement('input');
title.setAttribute('name','W-TITLE');
title.setAttribute('value',s);
f.appendChild(title);
d.getElementsByTagName('head')[0].appendChild(f);
d.charset='shift_jis';
f.submit();
}
}());
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。