Skip to content

Instantly share code, notes, and snippets.

@ivey
Created August 7, 2008 03:33
Show Gist options
  • Save ivey/4320 to your computer and use it in GitHub Desktop.
Save ivey/4320 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment