Skip to content

Commit

Permalink
Fix team_scores csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Saturn committed Jan 14, 2019
1 parent 3907d0b commit a3541a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions soccer/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,12 @@ def team_scores(self, team_scores, time):
headers = ['Date', 'Home Team Name', 'Home Team Goals',
'Away Team Goals', 'Away Team Name']
result = [headers]
result.extend([score["date"].split('T')[0], score['homeTeamName'],
score['result']['goalsHomeTeam'],
score['result']['goalsAwayTeam'], score['awayTeamName']]
for score in team_scores['fixtures']
result.extend([score["utcDate"].split('T')[0],
score['homeTeam']['name'],
score['score']['fullTime']['homeTeam'],
score['score']['fullTime']['awayTeam'],
score['awayTeam']['name']]
for score in team_scores['matches']
if score['status'] == 'FINISHED')
self.generate_output(result)

Expand Down

0 comments on commit a3541a7

Please sign in to comment.