ブクログ登録

    @@ -10,7 +10,10 @@ var amazon_url_re = /https?:\/\/www\.amazon\.co\.jp\/(?:.*\/)?dp\/([^?\/]+)/; var here = location.href; var m; -/* Amazon なら URL から ASIN 抜き出し */ -if (m = here.match(amazon_url_re)) location.href = base_url + m[1]; -/* そうでなければテキスト全体から ISBN 抜き出し */ -if (m = document.body.innerText.match(/ISBN\s*([0-9-]+)/)) location.href = base_url + m[1]; +if (m = here.match(amazon_url_re)) { + /* Amazon なら URL から ASIN 抜き出し */ + location.href = base_url + m[1]; +} else if (m = document.body.innerText.match(/ISBN(?:-1[03])?\s*([0-9-]+)/)) { + /* そうでなければテキスト全体から ISBN 抜き出し */ + location.href = base_url + m[1]; +}
  • /*
     * @title ブクログ登録
     * @description 今見ているAmazon.co.jpページの書籍をブクログに登録
     * @include https://www.amazon.co.jp/*
     * @license MIT License
     * @require 
     */
    
    var base_url = "https://booklog.jp/search?service_id=1&index=All&keyword=";
    var amazon_url_re = /https?:\/\/www\.amazon\.co\.jp\/(?:.*\/)?dp\/([^?\/]+)/;
    var here = location.href;
    var m;
    if (m = here.match(amazon_url_re)) {
        /* Amazon なら URL から ASIN 抜き出し */
        location.href = base_url + m[1];
    } else if (m = document.body.innerText.match(/ISBN(?:-1[03])?\s*([0-9-]+)/)) {
        /* そうでなければテキスト全体から ISBN 抜き出し */
        location.href = base_url + m[1];
    }
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2019/03/09 00:30:04 - 2019-03-09
  2. 2019/02/18 15:32:00 - 2019-02-18
  3. 2019/02/18 01:00:26 - 2019-02-18
  4. 2019/02/18 00:36:04 - 2019-02-18
  5. 2019/02/18 00:30:03 - 2019-02-18