From 4b9b749f2ae5fa9aaafe3653bb8cdafe84727a59 Mon Sep 17 00:00:00 2001 From: Luo Yicheng Date: Mon, 28 Sep 2015 02:25:55 +0800 Subject: [PATCH] Fix an update on ESPN scoreboard URL and fix possible false in string comparison --- espn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/espn.py b/espn.py index c464ba9..3090d45 100644 --- a/espn.py +++ b/espn.py @@ -121,7 +121,7 @@ def _league_time(league): Return league specific game info -- number of quarters, regulation time limit, regular quarter length. """ - if league is 'nba': + if league == 'nba': num_quarters = 4 regulation_time = 48 regular_quarter = 12 @@ -185,6 +185,7 @@ def parse_plays(game_id, league='nba'): """Parse a game's Play-By-Play page on ESPN.""" league = league.lower() espn = 'http://scores.espn.go.com/' + league + '/playbyplay?' +\ + espn = 'http://scores.espn.go.com/' + league + '/playbyplay?gameId=' +\ game_id + '&period=0' url = urllib2.urlopen(espn) print url.geturl()