Sha256: 413daf3122813f0b6925a6b4e745542ec022c0d1c1e8ef7b32324e780dc836b5
Contents?: true
Size: 586 Bytes
Versions: 13
Compression:
Stored size: 586 Bytes
Contents
# frozen_string_literal: true module AhlScraper class TeamDataFetcher def initialize(season_id) @season_id = season_id end def call JSON.parse(Nokogiri::HTML(URI.parse(url).open).text[5..-2], symbolize_names: true)&.first&.dig(:sections)&.map { |t| t[:data] }&.flatten end private def url "https://lscluster.hockeytech.com/feed/index.php?feed=statviewfeed&view=teams&groupTeamsBy=division&site_id=1&season=#{@season_id}&key=50c2cd9b5e18e390&client_code=ahl&league_id=4&callback=json" # rubocop:disable Layout/LineLength end end end
Version data entries
13 entries across 13 versions & 1 rubygems