Skip to content

Instantly share code, notes, and snippets.

@ivey
Created August 7, 2008 03:33

Revisions

  1. ivey revised this gist Aug 7, 2008. 1 changed file with 0 additions and 7 deletions.
    7 changes: 0 additions & 7 deletions ideal.rb
    Original file line number Diff line number Diff line change
    @@ -1,7 +0,0 @@
    def following
    @following ||= twitter.friends_for(uid, :list_only => true)
    end

    def followers
    @followers ||= twitter.followers_for(uid, :list_only => true)
    end
  2. ivey revised this gist Aug 7, 2008. 2 changed files with 7 additions and 0 deletions.
    File renamed without changes.
    7 changes: 7 additions & 0 deletions ideal.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    def following
    @following ||= twitter.friends_for(uid, :list_only => true)
    end

    def followers
    @followers ||= twitter.followers_for(uid, :list_only => true)
    end
  3. ivey renamed this gist Aug 7, 2008. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. ivey created this gist Aug 7, 2008.
    25 changes: 25 additions & 0 deletions gistfile1.rbx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    def following_pages
    twitter_user.friends_count.to_i / 100 + 1
    end

    def following
    return @following if @following
    @following = []
    1.upto(following_pages) do |i|
    @following += twitter.friends_for(uid, :page => i, :lite => true)
    end
    @following
    end

    def followers_pages
    twitter_user.followers_count.to_i / 100 + 1
    end

    def followers
    return @followers if @followers
    @followers = []
    1.upto(followers_pages) do |i|
    @followers += twitter.followers_for(uid, :page => i, :lite => true)
    end
    @followers
    end