[Twitter] FOLLOWS YOU on Following

  • /*
     * @title [Twitter] FOLLOWS YOU on Following
     * @description Twitter の Following ページでフォローされているかどうかを表示する http://m4i.hatenablog.com/entry/2011/12/16/062448
     * @include http://twitter.com/*
     * @include https://twitter.com/*
     * @license MIT License
     */
    twttr.anywhere.api.util.makeRemoteRequest(
      'followers/ids',
      [{
        cursor: -1,
        user_id: twttr.currentUser.idStr,
      }],
      { success: function(result) {
        var ids = {};
        $.each(result.ids, function(_, id) { ids[id] = true; });
    
        $('.account').each(function() {
          var $account = $(this);
          if ($account.find('.follow-status').length) return;
    
          var $status = $('<span>').addClass('follow-status');
          if (ids[$account.attr('data-user-id')]) {
            $status.text('follows you');
          } else {
            $status.text('not follow you').css('color', '#f00');
          }
          $account.find('.account-group')
            .after($status)
            .after('<br>');
        });
      }}
    );
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2011/12/31 06:09:15 - 2011-12-31
  2. 2011/12/16 06:37:00 - 2011-12-16
  3. 2011/12/16 06:34:06 - 2011-12-16
  4. 2011/12/16 06:11:07 - 2011-12-16