Esempio n. 1
0
 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
Esempio n. 2
0
    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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
    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
Esempio n. 6
0
    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()
Esempio n. 7
0
 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
Esempio n. 8
0
 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()