ついったーのwebでTL自動更新

  • /*
     * @title ついったーのwebでTL自動更新
     * @description document.getElementsByClassName('new-tweets-bar js-new-tweets-bar')[0]を定期的にクリックするだけ。ではなくいろいろプロモーションを消す
     * @include https://twitter.com/*
     * @license MIT License
     */
    
    
    setInterval((function(){
    		// 自動更新
    		if(document.getElementsByClassName('new-tweets-bar js-new-tweets-bar').length>0){
    			document.getElementsByClassName('new-tweets-bar js-new-tweets-bar')[0].click();
    			// ここではてなスターを消してから全部につくる
    			setTimeout((function(){
    				$('.hatena-star-comment-container,.hatena-star-star-container').remove();
    				Hatena.Star.loaded = false;
    				Hatena.Star.EntryLoader.entries = undefined;
    				new Hatena.Star.EntryLoader();
    			}),2000);
    		}
    
    
    		// アカウント
    		while(document.querySelectorAll('li .promoted-account').length!=0){
    			document.querySelector('li .promoted-account').parentNode.parentNode.removeChild(document.querySelector('.promoted-account').parentNode);
    		}
    
    		// アカウントの小さいの
    		while(document.querySelectorAll('div .promoted-account').length!=0){
    			document.querySelector('div .promoted-account').parentNode.removeChild(document.querySelector('.promoted-account'));
    		}
    
    		// ツイート
    		while(document.querySelectorAll('.promoted-tweet').length!=0){
    			document.querySelector('.promoted-tweet').parentNode.parentNode.removeChild(document.querySelector('.promoted-tweet').parentNode);
    		}
    		// 広告
    		while(document.querySelectorAll('div.dashboard iframe#j_ad').length!=0){
    			document.querySelector('div.dashboard iframe#j_ad').parentNode.removeChild(document.querySelector('div.dashboard iframe#j_ad'));
    		}
    
    		// トレンド
    		while(document.querySelectorAll('li.promoted-trend').length!=0){
    			document.querySelector('li.promoted-trend').parentNode.removeChild(document.querySelector('li.promoted-trend'));
    		}
    	}),1000);
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2013/05/19 14:06:01 - 2013-05-19
  2. 2013/03/25 14:38:26 - 2013-03-25
  3. 2013/03/25 14:34:47 - 2013-03-25
  4. 2013/03/24 15:15:03 - 2013-03-24
  5. 2013/03/24 15:09:17 - 2013-03-24
  6. 2013/03/24 14:43:36 - 2013-03-24
  7. 2013/03/24 14:37:29 - 2013-03-24
  8. 2013/03/24 14:26:32 - 2013-03-24
  9. 2013/03/24 14:25:49 - 2013-03-24
  10. 2013/03/06 17:46:30 - 2013-03-06