# i had a bunch of twitter XML archive files. I wanted a hash of all the # usernames mentioned therein. hash3 = Hash.new (1..159).collect {|i| Nokogiri::XML(open("/home/tom/twitter_archive2/#{i}.xml").readlines.join) }.collect {|twt| twt.search("status").collect {|i| [i.search("in_reply_to_user_id")[0].content, i.search("in_reply_to_screen_name")[0].content] }.delete_if {|i| i == ["", ""] }.uniq }.each {|arr| arr.each {|item| hash3[item[0]] = item[1] } }