Class: EhbrsRubyUtils::Videos::Opensubtitles::Parsers::Episode

Inherits:
Aranha::Parsers::Html::ItemList
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/videos/opensubtitles/parsers/episode.rb

Constant Summary collapse

ITEMS_XPATH =
'//table[@id = "search_results"]/tbody/tr[starts-with(@id, "name")]'

Instance Method Summary collapse

Instance Method Details

#dataObject



16
17
18
# File 'lib/ehbrs_ruby_utils/videos/opensubtitles/parsers/episode.rb', line 16

def data
  { subtitles: items_data, next_page_href: next_page_href }
end

#items_xpathObject



12
13
14
# File 'lib/ehbrs_ruby_utils/videos/opensubtitles/parsers/episode.rb', line 12

def items_xpath
  ITEMS_XPATH
end

#next_page_hrefObject



20
21
22
# File 'lib/ehbrs_ruby_utils/videos/opensubtitles/parsers/episode.rb', line 20

def next_page_href
  nokogiri.at_xpath('//*[@id = "pager"]//a[text() = ">>"]/@href').if_present(&:text)
end