Class: Twithub::Twitter

Inherits:
Object
  • Object
show all
Defined in:
lib/twithub/twitter.rb

Class Method Summary collapse

Class Method Details

.entries_for(username) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/twithub/twitter.rb', line 3

def self.entries_for(username)
  return [] unless username
  ::Twitter.user_timeline(username).map do |status|
    url = "http://twitter.com/#{status.from_user}/status/#{status.id}"
    TwitterEntry.new.with_content(status.text).with_username(status.from_user).with_posted_at(status.created_at).with_url(url)
  end 
end