Stack Stock Books の本をカーリルで読みたい
by
miyamuko
2010-09-22 [2010/09/22 11:04:55]
Stack Stock Books で表示している本をカーリルの読みたいリストに追加する
@@ -4,29 +4,20 @@
* @include http://stack.nayutaya.jp/
* @license MIT License
* @require
+ * @thanks http://q.hatena.ne.jp/1213176191
*/
-// Based on http://q.hatena.ne.jp/1213176191
-
-var a = document.getElementById('ASIN.1').value;
-var i1 = document.createElement("input");
-var i2 = document.createElement("input");
+var asin = document.getElementById('ASIN.1').value;
+var status = "wish";
+var html = [
+ '<html><body>',
+ '<form id="hoge" method="POST" action="http://calil.jp/add_book">',
+ '<input type="hidden" name="asin" value="' + asin + '">',
+ '<input type="hidden" name="status" value="' + status + '">',
+ '</form>',
+ '</body></html>'
+];
var w = window.open();
-var f = document.createElement("form");
-f.id = "hoge";
-f.method = "POST";
-f.action = "http://calil.jp/add_book";
-w.document.body.appendChild(f);
-
-i1.type = "hidden";
-i1.name = "asin";
-i1.value = a;
-f.appendChild(i1);
-
-i2.type = "hidden";
-i2.name = "status";
-i2.value = s;
-f.appendChild(i2);
-
+w.document.write(html.join(""));
w.document.getElementById('hoge').submit();
/*
* @title Stack Stock Books の本をカーリルで読みたい
* @description Stack Stock Books で表示している本をカーリルの読みたいリストに追加する
* @include http://stack.nayutaya.jp/
* @license MIT License
* @require
* @thanks http://q.hatena.ne.jp/1213176191
*/
var asin = document.getElementById('ASIN.1').value;
var status = "wish";
var html = [
'<html><body>',
'<form id="hoge" method="POST" action="http://calil.jp/add_book">',
'<input type="hidden" name="asin" value="' + asin + '">',
'<input type="hidden" name="status" value="' + status + '">',
'</form>',
'</body></html>'
];
var w = window.open();
w.document.write(html.join(""));
w.document.getElementById('hoge').submit();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。