Class: YouTubeIt::Parser::ActivityParser

Inherits:
FeedParser
  • Object
show all
Defined in:
lib/youtube_it/parser.rb

Overview

Returns an array of the user’s activity

Instance Method Summary collapse

Methods inherited from FeedParser

#initialize, #parse, #parse_single_entry, #parse_videos, #remove_bom

Constructor Details

This class inherits a constructor from YouTubeIt::Parser::FeedParser

Instance Method Details

#parse_content(content) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/youtube_it/parser.rb', line 126

def parse_content(content)
  doc = Nokogiri::XML(content.body)
  feed = doc.at("feed")

  activities = []
  feed.css("entry").each do |entry|
    if parsed_activity = parse_activity(entry)
      activities << parsed_activity
    end
  end

  return activities
end