nml nowplaying

    @@ -13,7 +13,7 @@ url = location.href, textarea = document.createElement("textarea"); if(amzn_anchor){ - amzn_link = decodeURIComponent(document.querySelector(".banner a[href^='http://www.amazon.co.jp']").search).replace(/.*location=/,"").replace(/&.*/,"")+'?tag='+asoc_id; + amzn_link = decodeURIComponent(amzn_anchor.search).replace(/.*location=/,"").replace(/&.*/,"")+'?tag='+asoc_id; } textarea.id = "nowlistening_textarea"; textarea.innerText = ["#nowplaying", title, url, amzn_link, "#nml"].join(" "); @@ -21,4 +21,4 @@ textarea.cols = 60; document.getElementById("album-intro").appendChild(textarea); textarea.select(); -})(); +})();
  • /*
     * @title nml nowplaying
     * @description NMLのアルバム画面でツイート用の詳細文章をコピーできるようにします
     * @include http://ml.naxos.jp/album/*
     * @license MIT License
     * @require 
     */
    (function(){
      var title = document.querySelector("#album-intro h2").innerText,
          amzn_anchor = document.querySelector(".banner a[href^='http://www.amazon.co.jp']"),
          amzn_link='',
          asoc_id = 'tetsujijp-22', /* 自分のものに適宜変更 */
          url = location.href,
          textarea = document.createElement("textarea");
      if(amzn_anchor){
        amzn_link = decodeURIComponent(amzn_anchor.search).replace(/.*location=/,"").replace(/&.*/,"")+'?tag='+asoc_id;
      }
      textarea.id = "nowlistening_textarea";
      textarea.innerText = ["#nowplaying", title, url, amzn_link, "#nml"].join(" ");
      textarea.rows = 5;
      textarea.cols = 60;
      document.getElementById("album-intro").appendChild(textarea);
      textarea.select();
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/01/29 01:36:33 - 2013-01-29
  2. 2013/01/29 01:06:03 - 2013-01-29
  3. 2013/01/28 23:00:33 - 2013-01-28
  4. 2013/01/15 14:10:44 - 2013-01-15