Hatena::Let SPAM Filter

    @@ -10,7 +10,7 @@ var re1 = /^(https?:)+\s*$/, re2 = /(https?:){2,}/; var wipeout = function(ctx) { - forEach.call(document.body.querySelectorAll('div.codelist'), function (item) { + forEach.call(ctx.querySelectorAll('div.codelist'), function (item) { var source_block = item.querySelectorAll('pre.packed-source'); if (source_block.length == 0) { item.style.display = 'none';
  • /*
     * @title Hatena::Let SPAM Filter
     * @description Hatena::Let の一覧から SPAM 投稿を消す(やっつけだけど)
     * @include http://let.hatelabo.jp/*
     * @license MIT License
     * @javascript_url
     */
    (function () {
        var forEach = Array.prototype.forEach;
        var re1 = /^(https?:)+\s*$/,
            re2 = /(https?:){2,}/;
        var wipeout = function(ctx) {
            forEach.call(ctx.querySelectorAll('div.codelist'), function (item) {
                var source_block = item.querySelectorAll('pre.packed-source');
                if (source_block.length == 0) {
                    item.style.display = 'none';
                    return;
                }
                var source = source_block[0];
                if (re1.exec(source.textContent) || re2.exec(source.textContent)) {
                    item.style.display = 'none';
                    return;
                }
            });
        };
        wipeout(document.body);
    })();
    
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2016/01/04 08:53:39 - 2016-01-04
  2. 2015/01/14 10:21:29 - 2015-01-14
  3. 2015/01/13 19:22:36 - 2015-01-13
  4. 2015/01/13 19:21:05 - 2015-01-13