Module: Fbref

Defined in:
lib/webget-football/fbref/page.rb,
lib/webget-football/fbref/config.rb,
lib/webget-football/fbref/leagues.rb,
lib/webget-football/fbref/download.rb,
lib/webget-football/fbref/page_schedule.rb

Defined Under Namespace

Classes: Configuration, Metal, Page

Constant Summary collapse

LEAGUES =
{
  ## todo/check: shorten - (auto-)add to base_url - comps/ - why? why not?
   'at.1' => {
     '2020/21' => 'comps/56/schedule/Austrian-Bundesliga-Scores-and-Fixtures',
     '2019/20' => 'comps/56/3213/schedule/2019-2020-Austrian-Bundesliga-Scores-and-Fixtures',
     '2018/19' => 'comps/56/2352/schedule/2018-2019-Austrian-Bundesliga-Scores-and-Fixtures',
    },

  'de.1' => {
    '2020/21' => 'comps/20/schedule/Bundesliga-Scores-and-Fixtures',
  },

  'eng.1' => {
     '2020/21' => 'comps/9/schedule/Premier-League-Scores-and-Fixtures',
   },

   'es.1' => {
    '2020/21' => 'comps/12/schedule/La-Liga-Scores-and-Fixtures',
   },

   'it.1' => {
     '2020/21' => 'comps/11/schedule/Serie-A-Scores-and-Fixtures',
   },

   'fr.1' => {
     '2020/21' => 'comps/13/schedule/Ligue-1-Scores-and-Fixtures',
   },

  'mx.1' => {
     '2020/21' => 'comps/31/schedule/Liga-MX-Scores-and-Fixtures',
     '2019/20' => 'comps/31/3267/schedule/2019-2020-Liga-MX-Scores-and-Fixtures',
     '2018/19' => 'comps/31/2252/schedule/2018-2019-Liga-MX-Scores-and-Fixtures',
  },

  'br.1' => {
     '2020' => 'comps/24/schedule/Serie-A-Scores-and-Fixtures',
  },

  'jp.1' => {
     '2020' => 'comps/25/schedule/J1-League-Scores-and-Fixtures',
     '2019' => 'comps/25/3923/schedule/2019-J1-League-Scores-and-Fixtures',
     '2018' => 'comps/25/1761/schedule/2018-J1-League-Scores-and-Fixtures',
  },
}

Class Method Summary collapse

Class Method Details

.configObject



13
# File 'lib/webget-football/fbref/config.rb', line 13

def self.config()    @config ||= Configuration.new;  end

.configure {|config| ... } ⇒ Object

lets you use

Fbref.configure do |config|
   config.convert.out_dir = './o'
end

Yields:



12
# File 'lib/webget-football/fbref/config.rb', line 12

def self.configure() yield( config ); end

.schedule(league:, season:) ⇒ Object

porcelain “api”



6
7
8
9
# File 'lib/webget-football/fbref/download.rb', line 6

def self.schedule( league:, season: )
  url = Metal.schedule_url( league: league, season: season )
  Metal.download_page( url )
end