Twitter Unfollow Bookmarklet

    @@ -15,7 +15,6 @@ var screen_name = document.querySelector('.timeline-user b').innerText; var authenticity_token = document.querySelector('input[name=authenticity_token]').value; - var ids = []; $.getJSON('http://api.twitter.com/1/friends/ids.json?screen_name='+screen_name+'&callback=?', null, function(ids){
  • /*
     * @title Twitter Unfollow Bookmarklet
     * @description twitter でfollowing を全員unfollow するブックマークレット http://d.hatena.ne.jp/laiso/20111029/p1
     * @include https://mobile.twitter.com/*
     * @license New BSD License
     * @require jQuery
     */
    
    /*
     * https://mobile.twitter.com/ のモバイルサイトへログインして https://mobile.twitter.com/following で実行
     */
    
    (function(){
      var LIMIT = 1000000000;
    
      var screen_name = document.querySelector('.timeline-user b').innerText;
      var authenticity_token = document.querySelector('input[name=authenticity_token]').value;
      $.getJSON('http://api.twitter.com/1/friends/ids.json?screen_name='+screen_name+'&callback=?', 
        null,
        function(ids){
          $(ids).each(function(i, id){
            if(LIMIT < i) return;
            endPoint = 'https://mobile.twitter.com/'+id+'/unfollow';
            $.ajax({
              type: 'POST',
              url: endPoint,
              data: 'authenticity_token='+authenticity_token+'&_method=delete&lasturl=%2Ffollowing',
              success: function(){
                console.log(i+' / '+LIMIT);
              }
            });
          });
        }
      );
    }())
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/10/29 20:14:55 - 2011-10-29
  2. 2011/10/29 19:58:42 - 2011-10-29
  3. 2011/10/29 19:57:28 - 2011-10-29
  4. 2011/10/29 19:51:12 - 2011-10-29
  5. 2011/10/29 15:59:25 - 2011-10-29
  6. 2011/10/29 01:05:01 - 2011-10-29
  7. 2011/10/29 00:58:58 - 2011-10-29