b.hatena on atnd

    @@ -5,6 +5,7 @@ */ // for 拡散お願いしますアドベントカレンダー2012 #拡散お願いします : ATND http://atnd.org/events/34752 +// example http://cache.gyazo.com/f9f9d298686ad7899da3e5741288fb50.png (function () { //var anchors = document.getElementsByTagName("a"); @@ -21,4 +22,3 @@ anc.parentNode.insertBefore(banc, anc.nextSibling); }; })() -
  • /*
     * @title b.hatena on atnd
     * @description atnd の #post-body のリンクのはてなブックマーク数を表示
     * @include http://atnd.org/events/*
     */
    
    // for 拡散お願いしますアドベントカレンダー2012 #拡散お願いします : ATND http://atnd.org/events/34752
    // example http://cache.gyazo.com/f9f9d298686ad7899da3e5741288fb50.png
    
    (function () {
      //var anchors = document.getElementsByTagName("a");
      var anchors = document.querySelectorAll("#post-body a");
      for (var i = 0; i < anchors.length; i++) {
        var anc = anchors[i];
        var banc = document.createElement("a");
        var bimg = document.createElement("img");
        banc.href = "http://b.hatena.ne.jp/entry/" + anc.href.replace(/#/g, '\u002523').replace(/^http(s{0,1}):\/\//, function (a, b) {
        return b ? 's/' : ''
      });
        bimg.src = "http://b.hatena.ne.jp/entry/image/" + anc.href.replace(/#/g, '\u002523');
        banc.appendChild(bimg);
        anc.parentNode.insertBefore(banc, anc.nextSibling);
      };
    })()
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/01/04 13:02:09 - 2013-01-04
  2. 2012/12/19 15:49:49 - 2012-12-19
  3. 2012/12/19 11:34:19 - 2012-12-19
  4. 2012/12/19 11:33:44 - 2012-12-19
  5. 2012/12/19 11:32:33 - 2012-12-19
  6. 2012/12/19 11:26:52 - 2012-12-19