Class: Twithub::Github

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

Class Method Summary collapse

Class Method Details

.entries_for(username) ⇒ Object



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

def self.entries_for(username)
  return [] unless username
  feed_url = "http://github.com/#{username}.atom"
  Feedzirra::Feed.fetch_and_parse(feed_url).entries.map do |entry|
    GithubEntry.new.with_content(entry.title).with_username(entry.author).with_posted_at(entry.published).with_url(entry.url)
  end 
end