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



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

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

#items_xpathObject



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

def items_xpath
  ITEMS_XPATH
end

#next_page_hrefObject



23
24
25
# File 'lib/ehbrs_ruby_utils/videos/opensubtitles/parsers/episode.rb', line 23

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