eventify 3.0.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd35658a298a68c09bba8dd2fb5d1fece295d85896d413f9ff71e3f6bec59045
4
- data.tar.gz: 992323d93ed64553ccc2d92f26c98082a75cda566ca91eebc2529bee796d257f
3
+ metadata.gz: 54fda616c115a12f36a6669b8aa00d7ee55c93ff6a6429b60c3bf6d45430a387
4
+ data.tar.gz: 56cb3e7c36b7134b115204007313007dfd0e8c9c29d638e861c19516455d23a0
5
5
  SHA512:
6
- metadata.gz: 2a516c267b2f36c12e5e8698d164b8e0e343177f8a440eb2841443d9e4c8fa7e27dd2d4f12d969d58f3f2cdc01009318a2983fd5b0f3b17c841df8e20bd790e0
7
- data.tar.gz: c2471416f81f9a3ed312149205ac0e0ee4772b511e6085a0d3d105354a721dcd17a445122799aa543d9e815b80bd93311e63adb3c07d4a26473ec9dc39518a2a
6
+ metadata.gz: 30cfd56696e7df477782d95a80133d36a85f999547a84f5403fc8ed863c4b7b2915e3d8ca8915cf622785c69fbf31c0dfc4ff6936b5f78385b23b488ecf1f5d1
7
+ data.tar.gz: 2ecb65581a878efc54f98432371c46ebc2d7eeb267592d677cb55422cce18572bc24618b3abc3fbc3cd2c484334c438a6dc2141a58eaf7cff36beaa3ccbc3bee
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Eventify
2
2
  [![Gem Version](https://badge.fury.io/rb/eventify.png)](http://badge.fury.io/rb/eventify)
3
- [![Build Status](https://api.travis-ci.org/jarmo/eventify.png)](http://travis-ci.org/jarmo/eventify)
4
3
  [![Coverage](https://coveralls.io/repos/jarmo/eventify/badge.png?branch=master)](https://coveralls.io/r/jarmo/eventify)
5
- [![Dependency Status](https://gemnasium.com/jarmo/eventify.png)](https://gemnasium.com/jarmo/eventify)
6
4
  [![Code Climate](https://codeclimate.com/github/jarmo/eventify.png)](https://codeclimate.com/github/jarmo/eventify)
7
5
 
8
6
  Are you tired of missing some cool concerts/events because you just didn't know them
@@ -12,7 +10,7 @@ of some event too late?
12
10
  If the answer was yes to either of these questions then Eventify can help you!
13
11
 
14
12
  Eventify will notify you about upcoming events from different
15
- providers/organizers in an aggregate way.
13
+ providers/organizers in an aggregated way.
16
14
 
17
15
  ## Installation
18
16
 
@@ -31,7 +29,7 @@ providers/organizers in an aggregate way.
31
29
  * Check your e-mail for information about upcoming events.
32
30
 
33
31
  * Edit configuration settings if defaults won't work for you:
34
-
32
+
35
33
  `$ vi ~/.eventify/config.yaml`
36
34
 
37
35
  ## Supported Providers
@@ -5,17 +5,17 @@ class Eventify::Database
5
5
 
6
6
  class << self
7
7
  def exists?(event)
8
- results = sqlite.execute "select 1 from event where id=? and provider=? and link=?", event.id, event.provider, event.link
8
+ results = sqlite.execute "select 1 from event where id=? and provider=? and link=?", [event.id, event.provider, event.link]
9
9
  !results.empty?
10
10
  end
11
11
 
12
12
  def save(event)
13
13
  sqlite.execute "insert into event values(?, ?, ?, ?, ?)",
14
- event.id,
14
+ [event.id,
15
15
  event.provider,
16
16
  event.title,
17
17
  event.link,
18
- event.date.to_s
18
+ event.date.to_s]
19
19
  end
20
20
 
21
21
  def events
@@ -4,15 +4,15 @@ require "time"
4
4
 
5
5
  module Eventify::Provider
6
6
  class ApolloKino < Base
7
- URL = "https://www.apollokino.ee/"
7
+ URL = "https://www.apollokino.ee/eng/movies?3064-actionType=1"
8
8
 
9
9
  class << self
10
10
  def fetch
11
- doc = Nokogiri::HTML(URI.open(URI.join(URL, "eng/soon"), {"Accept-Encoding" => "gzip,deflate"}))
12
- doc.search(".EventList-container > div").map do |item|
13
- title_node = item.at("h2 a")
14
- url = URI.join(URL, title_node["href"]).to_s
15
- date = Time.strptime(item.at(".event-releaseDate b").content, "%d.%m.%Y")
11
+ doc = Nokogiri::HTML(URI.open(URL))
12
+ doc.search(".schedule__item").map do |item|
13
+ title_node = item.at(".movie-card__title a")
14
+ url = title_node["href"]
15
+ date = Time.strptime(item.at(".movie-card__label").content.gsub(/In Cinemas /, ""), "%m/%d/%Y")
16
16
  new id: url, title: title_node.content, link: url, date: date
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  class Eventify
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
@@ -3,21 +3,21 @@ require "spec_helper"
3
3
  describe Eventify::Provider::ApolloKino do
4
4
  context "#fetch" do
5
5
  it "fetches events" do
6
- stub_request(:get, URI.join(Eventify::Provider::ApolloKino::URL, "eng/soon").to_s).to_return(body: File.read(File.expand_path("../../support/apollo_kino.html", __dir__)))
6
+ stub_request(:get, Eventify::Provider::ApolloKino::URL.to_s).to_return(body: File.read(File.expand_path("../../support/apollo_kino.html", __dir__)))
7
7
 
8
8
  events = Eventify::Provider::ApolloKino.fetch
9
9
  expect(events).to eq([
10
10
  Eventify::Provider::ApolloKino.new(
11
- title: "Võimlemisklubi Janika TALVEKONTSERT",
12
- link: "https://www.apollokino.ee/eng/event/4127/title/v%C3%B5imlemisklubi_janika_talvekontsert/",
13
- date: Time.parse("2021-01-31"),
14
- id: "https://www.apollokino.ee/eng/event/4127/title/v%C3%B5imlemisklubi_janika_talvekontsert/"
11
+ title: "Ingeborg Bachmann - Journey Into the Desert",
12
+ link: "https://www.apollokino.ee/eng/event/5325/ingeborg_bachmann_-_journey_into_the_desert?theatreAreaID=1004",
13
+ date: Time.parse("2024-06-14"),
14
+ id: "https://www.apollokino.ee/eng/event/5325/ingeborg_bachmann_-_journey_into_the_desert?theatreAreaID=1004"
15
15
  ),
16
16
  Eventify::Provider::ApolloKino.new(
17
- title: "Jurassic World: Dominion",
18
- link: "https://www.apollokino.ee/eng/event/4064/title/jurassic_world_dominion/",
19
- date: Time.parse("2022-06-10"),
20
- id: "https://www.apollokino.ee/eng/event/4064/title/jurassic_world_dominion/",
17
+ title: "Inside Out 2",
18
+ link: "https://www.apollokino.ee/eng/event/5395/inside_out_2?theatreAreaID=1004",
19
+ date: Time.parse("2024-07-15"),
20
+ id: "https://www.apollokino.ee/eng/event/5395/inside_out_2?theatreAreaID=1004",
21
21
  ),
22
22
  ])
23
23
  end