Class: Tubeclip::Parser::PlaylistsFeedParser

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

Overview

:nodoc:

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 Tubeclip::Parser::FeedParser

Instance Method Details

#parse_content(content) ⇒ Object

return array of playlist objects



99
100
101
102
103
104
105
106
107
108
# File 'lib/tubeclip/parser.rb', line 99

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

  playlists = []
  feed.css("entry").each do |entry|
    playlists << parse_entry(entry)
  end
  return playlists
end