0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ASIN取得ブックマークレットをWP:AmazonJSプラグイン向けに拡張

Last updated at Posted at 2013-04-16

自分用バックアップ的メモです。

いつぞやどこからか拾ったASIN取得のブックマークレットです

javascript:var%20li=document.getElementsByTagName('li'),i=0,e,t;while(e=li[i++])void((t=e.innerHTML).match(/ASIN:|ISBN-10:/)&&prompt('ASIN/ISBN-10',t.replace(/^.+%20(.+)$/,'$1')))

これを、最近「Simple Amazon」から入れ替えた「AmazonJSプラグイン」のデフォルトショートコード向けに拡張しました。

javascript:var%20title=document.title;var%20li=document.getElementsByTagName('li'),i=0,e,t;while(e=li[i++])void((t=e.innerHTML).match(/ASIN:|ISBN-10:/)&&prompt('ASIN/ISBN-10',t.replace(/^.+%20(<\/b>)?(.+)$/,'[amazonjs asin="$2" locale="JP" tmpl="Small" title="'+title+'"]')))

えぇ、誰でもできる拡張ですとも^^

Amazonアソシエイトの短縮URLを取得するブックマークレット | 暇魂 -HiMA TAMA-を元にさせていただき、新しくしました。

javascript:(function(){var d=document,asin=d.getElementById('ASIN').value,atitle=d.getElementById('btAsinTitle').innerHTML;prompt('WP:AmazonJS','[amazonjs asin="'+asin+'" locale="JP" tmpl="Small" title="'+atitle+'"]');})();
0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?