DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Quick Script To Download Members Of Twitter List Using Ruby And Twitter Gem

04.01.2010
| 3879 views |
  • submit to reddit
        // Use twitter gem to download members of ruby list, using cursors for multiple pages

#!/usr/bin/ruby

require 'rubygems'
require 'twitter'

httpauth = Twitter::HTTPAuth.new('<username>', '<password>')

client = Twitter::Base.new(httpauth)

m = client.list_members('<listowner>', '<listname>', -1)
while m.next_cursor != 0
m.users.each {|ppc| puts ppc.screen_name}
m = client.list_members('<listowner>', '<listname>', m.next_cursor)
end