eventify 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/eventify/database.rb +3 -3
- data/lib/eventify/provider/apollo_kino.rb +6 -6
- data/lib/eventify/version.rb +1 -1
- data/spec/eventify/provider/apollo_kino_spec.rb +9 -9
- data/spec/support/apollo_kino.html +2752 -986
- metadata +2 -3
- data/.travis.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54fda616c115a12f36a6669b8aa00d7ee55c93ff6a6429b60c3bf6d45430a387
|
4
|
+
data.tar.gz: 56cb3e7c36b7134b115204007313007dfd0e8c9c29d638e861c19516455d23a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30cfd56696e7df477782d95a80133d36a85f999547a84f5403fc8ed863c4b7b2915e3d8ca8915cf622785c69fbf31c0dfc4ff6936b5f78385b23b488ecf1f5d1
|
7
|
+
data.tar.gz: 2ecb65581a878efc54f98432371c46ebc2d7eeb267592d677cb55422cce18572bc24618b3abc3fbc3cd2c484334c438a6dc2141a58eaf7cff36beaa3ccbc3bee
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# Eventify
|
2
2
|
[](http://badge.fury.io/rb/eventify)
|
3
|
-
[](http://travis-ci.org/jarmo/eventify)
|
4
3
|
[](https://coveralls.io/r/jarmo/eventify)
|
5
|
-
[](https://gemnasium.com/jarmo/eventify)
|
6
4
|
[](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
|
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
|
data/lib/eventify/database.rb
CHANGED
@@ -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(
|
12
|
-
doc.search(".
|
13
|
-
title_node = item.at("
|
14
|
-
url =
|
15
|
-
date = Time.strptime(item.at(".
|
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
|
data/lib/eventify/version.rb
CHANGED
@@ -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,
|
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: "
|
12
|
-
link: "https://www.apollokino.ee/eng/event/
|
13
|
-
date: Time.parse("
|
14
|
-
id: "https://www.apollokino.ee/eng/event/
|
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: "
|
18
|
-
link: "https://www.apollokino.ee/eng/event/
|
19
|
-
date: Time.parse("
|
20
|
-
id: "https://www.apollokino.ee/eng/event/
|
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
|