def retrieveShotsFromUrl(self): """ Retrieve shot information for game from ESPN URL. """ try: url = nba_shots + str(self.game_id) if self.verbose: print(url) shots = retrieveEspnNbaData.dataFromUrl(url, 'shots', self.game_id) except ValueError: # need some stuff to spit out error info... print('Failed to retreive shot locations for game ' + str(gameid)) shots = list() self.shots = shots
def retrievePBPFromUrl(self): """ Retrieve play-by-play data for game from ESPN URL. """ try: url = nba_pbp + str(self.game_id) + "&period=0" if self.verbose: print(url) pbp = retrieveEspnNbaData.dataFromUrl(url, 'pbp', self.game_id) except ValueError: # need some stuff to spit out error info... print('Failed to retreive play-by-play for game ' + str(gameid)) pbp = dict() self.play_by_play = pbp
def retrievePBPFromUrl(self): """ Retrieve play-by-play data for game from ESPN URL. """ try: url = nba_pbp + str(self.game_id) pbp = retrieveEspnNbaData.dataFromUrl(url, 'pbp', self.game_id) except ValueError: # need some stuff to spit out error info... print('Failed to retreive play-by-play for game ' + str(gameid)) pbp = dict() self.play_by_play = pbp
def retrieveRecapFromUrl(self): """ Retreive recap / summary data for game from ESPN URL. """ try: url = nba_ext + str(self.game_id) if self.verbose: print(url) ext = retrieveEspnNbaData.dataFromUrl(url, 'ext', self.game_id) except ValueError: # need some stuff to spit out error info... print('Failed to retreive recap for game ' +\ str(self.game_id)) ext = dict() self.recap = ext
def retrieveBoxScoreFromUrl(self): """ Retrieve box score information for game from ESPN URL. """ try: url = nba_box + str(self.game_id) if self.verbose: print(url) box = retrieveEspnNbaData.dataFromUrl(url, 'box', self.game_id) self.player_stats = box['player_info'] self.game_stats = box['game_info'] except ValueError: # need some stuff to spit out error info... print('Failed to retreive box score for game ' + str(gameid)) box = dict()
def retrieveBoxScoreFromUrl(self): """ Retrieve box score information for game from ESPN URL. """ try: url = nba_box + str(self.game_id) if self.verbose: print(url) box = retrieveEspnNbaData.dataFromUrl(url, 'box', self.game_id) if box: self.player_stats = box['player_info'] self.game_stats = box['game_info'] else: self.player_stats = {} self.game_stats = {} except ValueError: # need some stuff to spit out error info... print('Failed to retreive box score for game ' + str(gameid)) box = dict()