eventify 4.0.1 → 4.0.3
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/lib/eventify/provider/livenation.rb +9 -8
- data/lib/eventify/version.rb +1 -1
- data/spec/eventify/provider/livenation_spec.rb +9 -9
- metadata +2 -4
- data/spec/support/livenation.html +0 -1444
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cab8361e0e868a7c5c9eaa2c001689be255fdd55c262e796685a924414dce628
|
4
|
+
data.tar.gz: b0c4066174fa5701a0921875b0782e10ea3d7aee850839800a3d9cbb5ba6cfda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 641d8b989537b8dd5e9a00b2c63cbf33d5ddaf698e1dc1a315d1ddd0592696da1f1ea9a2f0cb3fae66af6a369e02dca3df638b6144249633bbd3d2978461dbe7
|
7
|
+
data.tar.gz: ccc7ebe3dae3272e62964fa66ae5a13a0b4be71edafba552cd35e904459323f7cf243f99ba20581514c8b289b75e179ff1b6f8e340c60ba3d0d4b9f971d2e1b1
|
@@ -1,20 +1,21 @@
|
|
1
1
|
require "open-uri"
|
2
|
-
require "nokogiri"
|
3
2
|
require "json"
|
4
3
|
require "time"
|
5
4
|
|
6
5
|
module Eventify::Provider
|
7
6
|
class Livenation < Base
|
8
|
-
URL = "https://www.livenation.ee/
|
7
|
+
URL = "https://www.livenation.ee/api/search/events?IncludePostponed=true&IncludeCancelled=false&Url=%2Fevent%2Fallevents&PageSize=200&Page=1&CountryIds=68"
|
9
8
|
|
10
9
|
class << self
|
11
10
|
def fetch
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
json = JSON.parse(URI.open(URL).read)
|
12
|
+
entries = json["documents"]
|
13
|
+
entries.map do |entry|
|
14
|
+
localization = entry["localizations"][0]
|
15
|
+
url = URI.parse(localization["url"])
|
16
|
+
url = URI.parse("https://www.livenation.ee#{url}") unless url.host
|
17
|
+
new id: entry["id"], title: localization["name"], link: url.to_s, date: Time.parse(entry["eventDate"])
|
18
|
+
end
|
18
19
|
end
|
19
20
|
end
|
20
21
|
end
|
data/lib/eventify/version.rb
CHANGED
@@ -3,21 +3,21 @@ require "spec_helper"
|
|
3
3
|
describe Eventify::Provider::Livenation do
|
4
4
|
context "#fetch" do
|
5
5
|
it "fetches events" do
|
6
|
-
stub_request(:get, Eventify::Provider::Livenation::URL).to_return(body: File.read(File.expand_path("../../support/livenation.
|
6
|
+
stub_request(:get, Eventify::Provider::Livenation::URL).to_return(body: File.read(File.expand_path("../../support/livenation.json", __dir__)))
|
7
7
|
|
8
8
|
events = Eventify::Provider::Livenation.fetch
|
9
9
|
expect(events).to eq([
|
10
10
|
Eventify::Provider::Livenation.new(
|
11
|
-
title: "
|
12
|
-
link: "https://www.livenation.ee/
|
13
|
-
date: Time.parse("
|
14
|
-
id: "
|
11
|
+
title: "Mogwai",
|
12
|
+
link: "https://www.livenation.ee/event/mogwai-tallinn-tickets-edp1569723",
|
13
|
+
date: Time.parse("2025-09-08T00:00:00Z"),
|
14
|
+
id: "1569723"
|
15
15
|
),
|
16
16
|
Eventify::Provider::Livenation.new(
|
17
|
-
title: "
|
18
|
-
link: "https://www.livenation.ee/
|
19
|
-
date: Time.parse("
|
20
|
-
id: "
|
17
|
+
title: "Smash Into Pieces",
|
18
|
+
link: "https://www.livenation.ee/event/smash-into-pieces-tallinn-tickets-edp1602333",
|
19
|
+
date: Time.parse("2025-10-06T00:00:00Z"),
|
20
|
+
id: "1602333"
|
21
21
|
)
|
22
22
|
])
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarmo Pertman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple-rss
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- spec/eventify_spec.rb
|
156
156
|
- spec/spec_helper.rb
|
157
157
|
- spec/support/apollo_kino.html
|
158
|
-
- spec/support/livenation.html
|
159
158
|
- spec/support/piletilevi-page1.json
|
160
159
|
- spec/support/piletilevi-page2.json
|
161
160
|
homepage: https://github.com/jarmo/eventify
|
@@ -192,6 +191,5 @@ test_files:
|
|
192
191
|
- spec/eventify_spec.rb
|
193
192
|
- spec/spec_helper.rb
|
194
193
|
- spec/support/apollo_kino.html
|
195
|
-
- spec/support/livenation.html
|
196
194
|
- spec/support/piletilevi-page1.json
|
197
195
|
- spec/support/piletilevi-page2.json
|