Class: Eventify::Provider::ApolloKino

Inherits:
Base
  • Object
show all
Defined in:
lib/eventify/provider/apollo_kino.rb

Constant Summary collapse

URL =
"https://www.apollokino.ee/"

Constants inherited from Base

Base::MissingAttributeError

Instance Attribute Summary

Attributes inherited from Base

#date, #id, #link, #title

Class Method Summary collapse

Methods inherited from Base

#<=>, #==, #exists?, #hash, #initialize, #provider, #save

Constructor Details

This class inherits a constructor from Eventify::Provider::Base

Class Method Details

.fetchObject



10
11
12
13
14
15
16
17
18
# File 'lib/eventify/provider/apollo_kino.rb', line 10

def fetch
  doc = Nokogiri::HTML(open(URI.join(URL, "eng/soon"), {"Accept-Encoding" => "gzip,deflate"}))
  doc.search(".EventList-container > div").map do |item|
    title_node = item.at("h2 a")
    url = URI.join(URL, title_node["href"]).to_s
    date = Time.strptime(item.at(".event-releaseDate b").content, "%d.%m.%Y")
    new id: url, title: title_node.content, link: url, date: date
  end
end