class Eventify::Provider::Livenation

Constants

URL

Public Class Methods

fetch() click to toggle source
# File lib/eventify/provider/livenation.rb, line 11
def fetch
  doc = Nokogiri::HTML(URI.open(URL))
  doc.search("script[type='application/ld+json']").map do |raw_item|
    item = JSON.parse(raw_item.content)
    next unless item["name"]
    new id: item["url"], title: item["name"], link: item["url"], date: Time.parse(item["startDate"])
  end.compact
end