generated from jacobtomlinson/python-container-action
-
Notifications
You must be signed in to change notification settings - Fork 9
/
get.py
41 lines (27 loc) · 1.39 KB
/
get.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from os import makedirs
from requests import get
data_cuba_url = "https://covid19cubadata.github.io/data/covid19-cuba.json"
data_cuba = get(data_cuba_url)
data_cuba_1_url = "https://covid19cubadata.github.io/data/covid19-cuba-1.json"
data_cuba_1 = get(data_cuba_1_url)
data_deaths_url = "https://covid19cubadata.github.io/data/covid19-fallecidos.json"
data_deaths = get(data_deaths_url)
data_world_url = "https://covid19cubadata.github.io/data/paises-info-dias.json"
data_world = get(data_world_url)
data_oxford_url = "https://covid19cubadata.github.io/data/oxford-indexes.json"
data_oxford = get(data_oxford_url)
data_protocols_url = "https://covid19cubadata.github.io/data/protocols.json"
data_protocols = get(data_protocols_url)
makedirs("data", exist_ok=True)
with open("data/covid19-cuba.json", mode="w", encoding="utf-8") as file:
file.write(data_cuba.text)
with open("data/covid19-cuba-1.json", mode="w", encoding="utf-8") as file:
file.write(data_cuba_1.text)
with open("data/covid19-fallecidos.json", mode="w", encoding="utf-8") as file:
file.write(data_deaths.text)
with open("data/paises-info-dias.json", mode="w", encoding="utf-8") as file:
file.write(data_world.text)
with open("data/oxford-indexes.json", mode="w", encoding="utf-8") as file:
file.write(data_oxford.text)
with open("data/protocols.json", mode="w", encoding="utf-8") as file:
file.write(data_protocols.text)