Skip to content

Commit 171aea0

Browse files
authored
Add files via upload
1 parent 22aa03c commit 171aea0

24 files changed

+101
-0
lines changed

favicon.ico

31.3 KB
Binary file not shown.

get_weather_icons.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
import urllib.request
3+
4+
day = ['01d.png', '02d.png', '03d.png', '04d.png', '09d.png', '10d.png', '11d.png', '13n.png', '50d.png']
5+
night = ['01n.png', '02n.png', '03n.png', '04n.png', '09n.png', '10n.png', '11n.png', '13n.png', '50n.png']
6+
7+
base_url = 'https://openweathermap.org/img/w/'
8+
img_dir = './img/'
9+
if not os.path.exists(img_dir):
10+
os.makedirs(img_dir)
11+
12+
# Obtenha os ícones de clima diurno
13+
for name in day:
14+
file_name = img_dir+name
15+
if not os.path.exists(file_name):
16+
urllib.request.urlretrieve(base_url+name, file_name)
17+
18+
# Repita a mesma coisa para ícones de clima noturno
19+
for name in night:
20+
file_name = img_dir+name
21+
if not os.path.exists(file_name):
22+
urllib.request.urlretrieve(base_url+name, file_name)

img/01d.png

2.79 KB
Loading

img/01n.png

2.75 KB
Loading

img/02d.png

2.9 KB
Loading

img/02n.png

2.85 KB
Loading

img/03d.png

2.5 KB
Loading

img/03n.png

2.5 KB
Loading

img/04d.png

2.71 KB
Loading

img/04n.png

2.71 KB
Loading

0 commit comments

Comments
 (0)