Amazon img + asin
by
noromanba
2013-07-26 [2013/07/26 07:19:46]
prompt minified Amazon link with img; LGTM for Hatena Space
@@ -2,18 +2,18 @@
* @title Amazon img + asin
* @description prompt minified Amazon link with img; LGTM for Hatena Space
* @include http://www.amazon.tld/*
- * @license MIT License http://nrm.mit-license.org/2013
+ * @license MIT License http://nrm.mit-license.org/2013
* @require
*/
-// c.f. http://space.hatena.ne.jp/~/14217943783080751724#14217943783080751726+34
+// c.f. http://space.hatena.ne.jp/~/14217943783080751724#14217943783080751726+45
(function () {
var tld, asin;
- if (!(tld = (/^www\.amazon\.([a-z\.]+)/.exec(location.hostname) || [])[1]) ||
+ if (!(tld = (/^www\.amazon\.([a-z\.]+)/.exec(location.hostname) || [])[1]) || // world
!(asin = (document.querySelector('#ASIN') || {}).value)) {
return;
}
var img = (document.querySelector('#prodImageContainer img, #main-image, #kib-ma-container-0 img') || {}).src;
prompt('copy me', (img + '\n' || '') + 'http://www.amazon.' + tld + '/dp/' + asin);
-})();
+})();
(function () {
var tld, asin;
if (!(tld = (/^www\.amazon\.([a-z\.]+)/.exec(location.hostname) || [])[1]) ||
!(asin = (document.querySelector('#ASIN') || {}).value)) {
return;
}
var img = (document.querySelector('#prodImageContainer img, #main-image, #kib-ma-container-0 img') || {}).src;
prompt('copy me', (img + '\n' || '') + 'http://www.amazon.' + tld + '/dp/' + asin);
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。