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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfd7ad797c2f6b778904c736597f27989ba121c13ec8993acfef3f342531534b
4
- data.tar.gz: 43814be3826b24b4c67c6e480c58cf5abd9e1ffea0680bbd35f63c5904d178f0
3
+ metadata.gz: cab8361e0e868a7c5c9eaa2c001689be255fdd55c262e796685a924414dce628
4
+ data.tar.gz: b0c4066174fa5701a0921875b0782e10ea3d7aee850839800a3d9cbb5ba6cfda
5
5
  SHA512:
6
- metadata.gz: d9ef84b47f8f77ae3d18eff968fb938efab4b4e73e8412a4db209eecf315168e249c775caf873b959f57c8a7ba7c6de3312305536461a5e30cbde5064185e3c4
7
- data.tar.gz: 9ca8da1b182aa553ddfc0d06fdbc2fb07b0ef68d06cf67349d4ba8be5cfb397936024365aa888129d1874ec21ea7d1b3085987cff94c56b4f0cad69f9f9f34a6
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/event/allevents"
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
- doc = Nokogiri::HTML(URI.open(URL))
13
- doc.search("script[type='application/ld+json']").map do |raw_item|
14
- item = JSON.parse(raw_item.content)
15
- next unless item["name"]
16
- new id: item["url"], title: item["name"], link: item["url"], date: Time.parse(item["startDate"])
17
- end.compact
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
@@ -1,3 +1,3 @@
1
1
  class Eventify
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.3"
3
3
  end
@@ -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.html", __dir__)))
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: "CLANNAD - In A Lifetime Farewell Tour",
12
- link: "https://www.livenation.ee/show/1310067/clannad-in-a-lifetime-farewell-tour/tallinn/2021-03-30/ee",
13
- date: Time.parse("2021-3-30"),
14
- id: "https://www.livenation.ee/show/1310067/clannad-in-a-lifetime-farewell-tour/tallinn/2021-03-30/ee"
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: "JAMES BLUNT - Once Upon A Mind Tour",
18
- link: "https://www.livenation.ee/show/1310003/james-blunt-once-upon-a-mind-tour/tallinn/2021-06-03/ee",
19
- date: Time.parse("2021-6-03"),
20
- id: "https://www.livenation.ee/show/1310003/james-blunt-once-upon-a-mind-tour/tallinn/2021-06-03/ee"
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.1
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-20 00:00:00.000000000 Z
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