Sha256: a9b144292c08928f85321324c93ea07c4a0c9f8c1da02210bde9768099c3ada0

Contents?: true

Size: 494 Bytes

Versions: 12

Compression:

Stored size: 494 Bytes

Contents

# frozen_string_literal: true

module AhlScraper
  class SeasonDataFetcher
    def call
      JSON.parse(Nokogiri::HTML(URI.parse(url).open).text[5..-2], symbolize_names: true)&.dig(:seasons)
    end

    private

    def url
      "https://lscluster.hockeytech.com/feed/index.php?feed=statviewfeed&view=bootstrap&season=latest&pageName=schedule&key=50c2cd9b5e18e390&client_code=ahl&site_id=1&league_id=&league_code=&lang=en&callback=json" # rubocop:disable Layout/LineLength
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ahl_scraper-0.4.0 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.8 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.7 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.6 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.5 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.4 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.3 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.2 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.1 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.3.0 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.2.0 lib/ahl_scraper/fetchers/season_data_fetcher.rb
ahl_scraper-0.1.1 lib/ahl_scraper/fetchers/season_data_fetcher.rb