Hide entry for no stars on Hatena star page

    
      
  • /*
     * @title Hide entry for no stars on Hatena star page
     * @description はてなスターページのURIで{domain}.s.hatena.ne.jp/{my}/entriesなページの星の付いていないエントリを隠す
     * @include http://*
     * @license MIT License
    */
    
    (function(){
      var loc = location.href;
      var pattern = /s\.hatena\.ne\.jp.+\/entries/i;
      if(!pattern.test(loc)) return;
      var econt = document.querySelectorAll('.entry-container');
      if(econt){
        var scont =[],i;
        for(i=0; i<econt.length; i++){
          scont[i] = econt[i].querySelector('.hatena-star-star-container img');
          if(!scont[i].nextSibling){
            econt[i].style.visibility = "hidden";
          }
        }
      }
    })();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2014/02/05 01:24:26 - 2014-02-05