Skip to content

Commit

Permalink
sports: update URL, not all teams have links, initialize games
Browse files Browse the repository at this point in the history
  • Loading branch information
pbui committed Aug 30, 2024
1 parent 8916f93 commit ef93482
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bobbit/modules/sports.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

# Constants

URL_TEMPLATE = 'http://www.cbssports.com/{sport}/scoreboard'
URL_TEMPLATE = 'https://www.cbssports.com/{sport}/scoreboard/'
GAME_RX = r'<div id="game-.*?</div></div></div>'
TEAM_RX = r'class="team-name-link">([^<]+)</a>.*?"total">([0-9]+)</td>'
TEAM_RX = r'class="team-name-link">([^<]+)</.*?"total">([0-9]+)</td>'
STATUS_RX = r'<div class="game-status [^"]+"><div[^>]*>([^<]+)</div>'
SPORTS_ALIAS = {
'cfb': 'college-football',
Expand Down Expand Up @@ -74,6 +74,7 @@ def format_game(game):
async def command(bot, message, sport, team=None):
sport = SPORTS_ALIAS.get(sport, sport)
url = URL_TEMPLATE.format(sport=sport)
games = []

async with bot.http_client.get(url) as result:
try:
Expand Down

0 comments on commit ef93482

Please sign in to comment.