Ejemplo n.º 1
0
from lolesports_api import Lolesports_API
from time import sleep

# só funciona pra jogos no momento
#get live
api = Lolesports_API()

print("funcionando2")
live_matches = api.get_live()
for live_match in live_matches['schedule']['events']:
    if live_match['state'] == 'finished':
        #id = '105562692794240160'
        #gameid = id + '2'
        #print(gameid)
        #if live_match['match']['id'] == id:
        # tem
        print(
            f"{live_match['match']['teams'][0]['code']} vs {live_match['match']['teams'][1]['code']}"
        )
        #match id
        print("funcionando2")
        print(f"{live_match['match']['id']}")
        print(f"{live_match['startTime']}")
        print(f"{live_match['league']}")
        #print(f"{live_match['id']}")
        #get_live_game(api.get_event_details(live_match['id']))

    #precisa do start time?
    #gameid = match id +2 se tiver começado ou +1 se n tiver

#idbusca = live_match['match']['id']
Ejemplo n.º 2
0
 def test_get_live(self):
     api = Lolesports_API()
     response = api.get_live()
     self.assertTrue(response)