fixing not able to display multiple sport leagues
This commit is contained in:
parent
e85d0113a1
commit
6b85ca6083
@ -463,32 +463,32 @@ def updateLeagueEvents(api_key, time):
|
||||
|
||||
print(all_data)
|
||||
|
||||
events = []
|
||||
#events = []
|
||||
|
||||
for league in all_data.keys():
|
||||
for d in all_data[league]:
|
||||
event = {}
|
||||
event['date'] = d['dateEvent']
|
||||
#for league in all_data.keys():
|
||||
#for d in all_data[league]:
|
||||
#event = {}
|
||||
#event['date'] = d['dateEvent']
|
||||
|
||||
if time == 'live':
|
||||
#if time == 'live':
|
||||
|
||||
event['progess'] = d['strProgress']
|
||||
event['status'] = d['strStatus']
|
||||
else:
|
||||
#event['progess'] = d['strProgress']
|
||||
#event['status'] = d['strStatus']
|
||||
#else:
|
||||
|
||||
event['round'] = d['intRound']
|
||||
event['time'] = d['strTime']
|
||||
event['home_team'] = d['strHomeTeam']
|
||||
#event['round'] = d['intRound']
|
||||
#event['time'] = d['strTime']
|
||||
#event['home_team'] = d['strHomeTeam']
|
||||
|
||||
event['away_team'] = d['strAwayTeam']
|
||||
#event['away_team'] = d['strAwayTeam']
|
||||
|
||||
if time != 'upcoming':
|
||||
event['away_score'] = d['intAwayScore']
|
||||
event['home_score'] = d['intHomeScore']
|
||||
#if time != 'upcoming':
|
||||
#event['away_score'] = d['intAwayScore']
|
||||
#event['home_score'] = d['intHomeScore']
|
||||
|
||||
events.append(event)
|
||||
leagues_info[league.upper()] = events
|
||||
all_settings['leagues'] = leagues_info
|
||||
#events.append(event)
|
||||
#leagues_info[league.upper()] = events
|
||||
all_settings['leagues'] = all_data
|
||||
|
||||
json.dump(all_settings, open( "csv/{}_games.json".format(time), 'w+' ))
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user