예제 #1
0
    def get_espn_ids(self, games):
        """
        Get espn game ids for all games that day

        :param list games: games today

        :return: Games with corresponding espn game ids
        """
        # Get all espn info
        response = espn_pbp.get_espn_date(self.date)
        game_ids = espn_pbp.get_game_ids(response)
        espn_games = espn_pbp.get_teams(response)

        # Match up
        for i in range(len(games)):
            for j in range(len(espn_games)):
                if games[i]['home_team'] in espn_games[j] or games[i]['away_team'] in espn_games[j]:
                    games[i]['espn_id'] = game_ids[j]

        return games
def date_response(game_date):
    """ Page that details all the games that day"""
    return espn_pbp.get_espn_date(game_date)