Sha256: 82ba5d47a46cd4c0fccd8674187f52d449767a56298a0f442a5307bd093769de
Contents?: true
Size: 581 Bytes
Versions: 12
Compression:
Stored size: 581 Bytes
Contents
module Fandango class Parser::Movie def initialize(entry) @entry = entry end # Return array of movie attributes. def parse @entry.summary_doc.css('li').map do |li| { title: parse_title(li), id: parse_id(li), } end end private def parse_title(li) li.at_css('a').content end # E.g. '141081' in fandango.com/the+adventures+of+tintin+3d_141081/movietimes def parse_id(li) li.at_css('a')['href'].match(%r{fandango\.com/.*_(?<id>\d+)/movietimes})[:id] end end end
Version data entries
12 entries across 12 versions & 1 rubygems