Beispiel #1
0
def reload_matches():
    data = get_fixtures()
    if data:
        for league in data["league"]:
            for event in league["events"]:
                print ("Match id : %s starts at %s : Team 1 %s VS Team 2 %s " % (event["id"], event["starts"], event["home"], event["away"]))
                match = MT.Match(
                                 event["id"],
                                 isodate.parse_datetime(event["starts"]),
                                 event["home"],event["away"],league["id"])
                add_update_record('Matches', match)
Beispiel #2
0
def reload_leagues():
    SPORT_ID = 88
    data = get_leagues()
    if data:
         xmldoc = minidom.parseString(data)
         leagues = xmldoc.getElementsByTagName('league')
         for child in leagues:
             #print(' League['+child.attributes["id"].value+'] - ' +
             #      child.firstChild.nodeValue)
             lg = LG.League( child.attributes["id"].value, child.firstChild.nodeValue, child.attributes["homeTeamType"].value)
             print ('League ['+ str(lg.id) +'] - ' + lg.name + ' downloaded @ ' + str(lg.timestamp))
             add_update_record('League', lg)
Beispiel #3
0
def reload_matches():
    data = get_fixtures()
    if data:
        for league in data["league"]:
            for event in league["events"]:
                print("Match id : %s starts at %s : Team 1 %s VS Team 2 %s " %
                      (event["id"], event["starts"], event["home"],
                       event["away"]))
                match = MT.Match(event["id"],
                                 isodate.parse_datetime(event["starts"]),
                                 event["home"], event["away"], league["id"])
                add_update_record('Matches', match)
Beispiel #4
0
def reload_sports():
    data = get_sports()
    if data:
        xmldoc = minidom.parseString(data)
        sports = xmldoc.getElementsByTagName('sport')
        for child in sports:
            #print(' Sport['+child.attributes["id"].value+'] - '+
            #      child.firstChild.nodeValue )
            sp = SP.Sport(child.attributes["id"].value,
                          child.firstChild.nodeValue)
            #print ('Sport ['+ str(sp.id) +'] - ' + sp.name +
            #       ' downloaded @ ' + str(sp.timestamp))
            add_update_record('Sport', sp)
Beispiel #5
0
def reload_sports():
    data = get_sports()
    if data:
         xmldoc = minidom.parseString(data)
         sports = xmldoc.getElementsByTagName('sport')
         for child in sports:
             #print(' Sport['+child.attributes["id"].value+'] - '+
             #      child.firstChild.nodeValue )
             sp = SP.Sport(
                           child.attributes["id"].value,
                           child.firstChild.nodeValue)
             #print ('Sport ['+ str(sp.id) +'] - ' + sp.name + 
             #       ' downloaded @ ' + str(sp.timestamp))
             add_update_record('Sport', sp)
Beispiel #6
0
def reload_leagues():
    SPORT_ID = 88
    data = get_leagues()
    if data:
        xmldoc = minidom.parseString(data)
        leagues = xmldoc.getElementsByTagName('league')
        for child in leagues:
            #print(' League['+child.attributes["id"].value+'] - ' +
            #      child.firstChild.nodeValue)
            lg = LG.League(child.attributes["id"].value,
                           child.firstChild.nodeValue,
                           child.attributes["homeTeamType"].value)
            print('League [' + str(lg.id) + '] - ' + lg.name +
                  ' downloaded @ ' + str(lg.timestamp))
            add_update_record('League', lg)