https://github.com/oanderoficial/monitorando-copa-do-mundo
  
  
    Monitorando partidas da copa do mundo 2022 com Python. Utilizando o módulo Requests para fazer requisições a API do temporeal.lance.com.br 
    https://github.com/oanderoficial/monitorando-copa-do-mundo
  
api python
        Last synced: 6 days ago 
        JSON representation
    
Monitorando partidas da copa do mundo 2022 com Python. Utilizando o módulo Requests para fazer requisições a API do temporeal.lance.com.br
- Host: GitHub
 - URL: https://github.com/oanderoficial/monitorando-copa-do-mundo
 - Owner: oanderoficial
 - License: mit
 - Created: 2022-12-04T23:58:44.000Z (almost 3 years ago)
 - Default Branch: main
 - Last Pushed: 2022-12-05T00:44:48.000Z (almost 3 years ago)
 - Last Synced: 2025-08-15T22:29:41.777Z (3 months ago)
 - Topics: api, python
 - Language: Python
 - Homepage:
 - Size: 2.93 KB
 - Stars: 0
 - Watchers: 1
 - Forks: 0
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 - License: LICENSE
 
 
Awesome Lists containing this project
README
          # Monitorando-copa-do-mundo
Monitorando partidas da copa do mundo 2022 com Python. Utilizando a biblioteca Requests para fazer requisições a API do temporeal.lance.com.br
```python
import requests 
from time import sleep 
from datetime import datetime
def get_match_date():
    return requests.get(
        url='https://temporeal.lance.com.br/storage/matches/copa-do-mundo-2022-28-11-2022-camaroesxservia.json'
    ).json()
update = None 
while True:
    dados = get_match_date()
    narracoes = dados['match']['narrations']
    ultima_narracao = narracoes[len(narracoes)-1]
    time =datetime.strptime(ultima_narracao['created_at'], '%Y-%m-%dT%H:%M:%S.000000Z')
    if(not update) or (time > update):
        update = time
        momento = narracoes[len(narracoes)-1]['moment']
        narracao_text = narracoes[len(narracoes)-1]['text']
        print (f'.\n.\n.\n{momento}" - {narracao_text}')
    sleep(30)
```