Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spastorino/290039 to your computer and use it in GitHub Desktop.
Save spastorino/290039 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
users = %w(wyeworks spastorino joseicosta smartinez87 nartub)
tweets = users.map { |user_name| Twitter::Search.new.from(user_name) }.
inject([]) { |tweets, search| tweets + search.fetch(5).results }.
sort { |t1, t2| Date.parse(t2.created_at) <=> Date.parse(t1.created_at) }[0..4]
tweets.each do |tweet|
puts tweet.created_at
puts tweet.from_user
puts tweet.profile_image_url
puts tweet.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment