ツタヤ在庫一括表示

    @@ -37,7 +37,7 @@ url: link, dataType: "text", success: function(data){ - var m = data.match(/<span class="tolShStkInMrk">([^<]+)<\/span>/); + var m = data.match(/在庫状況:<span>([^<]+)<\/span>/); if (m) t.nodeValue = m[1]; },
  • /*
     * @title ツタヤ在庫一括表示
     * @description TSUTAYAの店頭在庫検索結果でこれを使うと表示されてる店舗の在庫を一括で取得し結果を表示します 巡回速度1/(0.5+res)[page/s]にしてあるので最短10秒かかります 詳しい使い方の説明は http://1mu.info/texts/tsutayalet/
     * @include 
     * @license 
     * @require jQuery
     */
    
    var wait = 500;
    
    if (location.href.indexOf("http://store.tsutaya.co.jp/tsutaya/articleList?")) {
    
      if (confirm("TSUTAYAのページに移動しますか"))
        location.href = "http://store.tsutaya.co.jp/";
    
    } else if (window.isGetting) {
    
      if (confirm("取得を中止しますか"))
        window.isGetting = false;
    
    } else {
    
      var links = document.links, storeLinks = [];
    
      for (var i = 0, link; link = links[i]; ++i)
        if (/http:\/\/store\.tsutaya\.co\.jp\/item\/[^\/]+\/\d+\.html\?storeId/.test(link.href))
          storeLinks.push(link);
    
      window.isGetting = true;
      (function getStockInfo() {
        if (window.isGetting && (window.isGetting = storeLinks.length))
          (function (link) {
            var t = link.parentNode.insertBefore(document.createTextNode("取得中..."), link.nextSibling);
            setTimeout(function () {
              $.ajax({
                type: "GET",
                url: link,
                dataType: "text",
                success: function(data){
                  var m = data.match(/在庫状況:<span>([^<]+)<\/span>/);
                  if (m)
                    t.nodeValue = m[1];
                },
                error: function () { t.nodeValue = "取得失敗";},
                complete: getStockInfo
              });
            }, wait);
          })(storeLinks.shift());
      })();
    }
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2018/11/29 12:40:03 - 2018-11-29
  2. 2017/02/26 21:48:18 - 2017-02-26
  3. 2016/11/01 22:19:13 - 2016-11-01
  4. 2016/10/28 17:51:18 - 2016-10-28
  5. 2016/10/06 10:10:19 - 2016-10-06
  6. 2016/10/06 04:26:13 - 2016-10-06
  7. 2016/10/05 10:15:07 - 2016-10-05
  8. 2016/10/05 10:13:50 - 2016-10-05
  9. 2014/10/21 19:05:18 - 2014-10-21
  10. 2014/02/18 01:23:43 - 2014-02-18
  11. 2013/11/02 13:44:16 - 2013-11-02
  12. 2013/04/11 15:54:12 - 2013-04-11
  13. 2013/03/10 16:26:30 - 2013-03-10
  14. 2012/11/10 11:01:24 - 2012-11-10
  15. 2011/12/06 15:24:48 - 2011-12-06
  16. 2011/12/06 15:06:07 - 2011-12-06