From c9596998f0a001d7e1a689cbbd4f9f43e9e196db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane?= Date: Thu, 19 Mar 2015 00:01:40 +0100 Subject: [PATCH] challonge scraper: use of display-name for users --- scraper/challonge.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scraper/challonge.py b/scraper/challonge.py index 2c91b53..db701d6 100644 --- a/scraper/challonge.py +++ b/scraper/challonge.py @@ -44,9 +44,7 @@ def get_date(self): return iso8601.parse_date(self.get_raw()['tournament']['tournament']['created_at']) def get_matches(self): - player_map = dict((p['participant']['id'], p['participant']['name'].strip() - if p['participant']['name'] - else p['participant']['username'].strip()) + player_map = dict((p['participant']['id'], p['participant']['display-name'].strip()) for p in self.get_raw()['participants']) matches = [] @@ -63,7 +61,7 @@ def get_matches(self): return matches def get_players(self): - return [p['participant']['name'].strip() if p['participant']['name'] else p['participant']['username'].strip() \ + return [p['participant']['display-name'].strip() \ for p in self.get_raw()['participants']] def _check_for_200(self, response):