Skip to content

Instantly share code, notes, and snippets.

@oc
Created July 7, 2010 23:05
Show Gist options
  • Select an option

  • Save oc/467424 to your computer and use it in GitHub Desktop.

Select an option

Save oc/467424 to your computer and use it in GitHub Desktop.
tweets = []
Dir['search*'].each do |f|
File.open(f).readlines.join.scan(/(<li class="hentry status .*?<\/li>)/m).each do |tweet|
author = tweet[0].scan(/;">(.*?)<\/a>.*?<span id="msgtxt/m)[0].to_s
text = tweet[0].scan(/<span id="msgtxt\d+" class="msgtxt \w+">(.*?)<\/span>/m)[0].to_s.gsub(/<.*?>/, '')
tweets << [author, text]
end
end
puts tweets.uniq.sort.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment