def getbox(gameid): ''' Given an ESPN game ID grabs the raw bow score feed page if mode==1; if mode==2, processes the page with parseESPN.getESPNbox module; ''' try: url = nba_box + str(gameid) box = parseESPN.processESPNpage(url, 'box') return box except ValueError: # need some stuff to spit out error info... print('Failed to retreive box score for game ' + str(gameid)) return list()
def getpbp(gameid): ''' Given an ESPN game ID grabs the raw play-by-play feed page if mode==1; if mode==2, processes the page with parseESPN.getESPNpbp module; ''' try: url = nba_pbp + str(gameid) + "&period=0" pbp = parseESPN.processESPNpage(url, 'pbp') return pbp except ValueError: # need some stuff to spit out error info... print('Failed to retreive play-by-play for game ' + str(gameid)) return list()
def getext(gameID): ''' Really this is the recap page, but also grabs some other info like game location and time, etc; also story analysis of game; ''' try: url = nba_ext + str(gameid) ext = parseESPN.processESPNpage(url, 'extta') return ext except ValueError: # need some stuff to spit out error info... print('Failed to retreive recap for game ' + str(gameid)) return list()