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_videos

Constructor Details

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

Instance Method Details

#parse_content(content) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/youtube_it/parser.rb', line 104

def parse_content(content)
  doc = REXML::Document.new(content.body)
  feed = doc.elements["feed"]
  
  activity = []
  feed.elements.each("entry") do |entry|
    parsed_activity = parse_activity(entry)
    if parsed_activity
      activity << parsed_activity
    end
  end
  
  return activity
end