Skip to content

Instantly share code, notes, and snippets.

@knishioka
Created October 2, 2012 18:17
Show Gist options
  • Save knishioka/3821979 to your computer and use it in GitHub Desktop.
Save knishioka/3821979 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'rexml/document'
def follow_list(name)
xml = nil
list = Array.new
url = "http://twitter.com/statuses/friends/#{name}.xml"
open(url) {|f| xml = REXML::Document.new f.read}
xml.elements.each("/users/user/screen_name"){|element|
list.push element.text
}
list
end
list = follow_list(ARGV[0])
list.each do |l|
puts l
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment