Skip to content

Commit e084b3b

Browse files
logicaNoticias
1 parent 261ea90 commit e084b3b

File tree

3 files changed

+485
-9
lines changed

3 files changed

+485
-9
lines changed

.idea/workspace.xml

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

areaTeste.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
"""
22
esse arquivo será deletado
33
"""
4+
import random
5+
import requests
6+
import json
7+
8+
# api cotações moedas
9+
# cotacoes = requests.get('https://economia.awesomeapi.com.br/last/USD-BRL,EUR-BRL,BTC-BRL')
10+
# cotacoes = cotacoes.json()
11+
#
12+
# dolar = str(cotacoes['USDBRL']['bid'])
13+
# dolar = dolar.replace('.', ',')
14+
# print('Dolar Americano')
15+
# print(f'R$ {dolar}')
16+
#
17+
# euro = str(cotacoes['EURBRL']['bid'])
18+
# euro = euro.replace('.', ',')
19+
# print('Euro')
20+
# print(f'R$ {euro}')
21+
#
22+
# btc = str(cotacoes['BTCBRL']['bid'])
23+
# print('Bitcoin')
24+
# print(f'{btc} mil reais')
25+
26+
# api previsão do tempo
27+
# previsao = requests.get('https://api.open-meteo.com/v1/forecast?latitude=-20.34&longitude=-47.78&hourly=temperature_2m')
28+
var = {'latitude': -20.375, 'longitude': -47.625, 'generationtime_ms': 0.2919435501098633, 'utc_offset_seconds': 0, 'timezone': 'GMT', 'timezone_abbreviation': 'GMT', 'elevation': 858.0, 'hourly_units': {'time': 'iso8601', 'temperature_2m': '°C'}, 'hourly': {'time': ['2022-12-12T00:00', '2022-12-12T01:00', '2022-12-12T02:00', '2022-12-12T03:00', '2022-12-12T04:00', '2022-12-12T05:00', '2022-12-12T06:00', '2022-12-12T07:00', '2022-12-12T08:00', '2022-12-12T09:00', '2022-12-12T10:00', '2022-12-12T11:00', '2022-12-12T12:00', '2022-12-12T13:00', '2022-12-12T14:00', '2022-12-12T15:00', '2022-12-12T16:00', '2022-12-12T17:00', '2022-12-12T18:00', '2022-12-12T19:00', '2022-12-12T20:00', '2022-12-12T21:00', '2022-12-12T22:00', '2022-12-12T23:00', '2022-12-13T00:00', '2022-12-13T01:00', '2022-12-13T02:00', '2022-12-13T03:00', '2022-12-13T04:00', '2022-12-13T05:00', '2022-12-13T06:00', '2022-12-13T07:00', '2022-12-13T08:00', '2022-12-13T09:00', '2022-12-13T10:00', '2022-12-13T11:00', '2022-12-13T12:00', '2022-12-13T13:00', '2022-12-13T14:00', '2022-12-13T15:00', '2022-12-13T16:00', '2022-12-13T17:00', '2022-12-13T18:00', '2022-12-13T19:00', '2022-12-13T20:00', '2022-12-13T21:00', '2022-12-13T22:00', '2022-12-13T23:00', '2022-12-14T00:00', '2022-12-14T01:00', '2022-12-14T02:00', '2022-12-14T03:00', '2022-12-14T04:00', '2022-12-14T05:00', '2022-12-14T06:00', '2022-12-14T07:00', '2022-12-14T08:00', '2022-12-14T09:00', '2022-12-14T10:00', '2022-12-14T11:00', '2022-12-14T12:00', '2022-12-14T13:00', '2022-12-14T14:00', '2022-12-14T15:00', '2022-12-14T16:00', '2022-12-14T17:00', '2022-12-14T18:00', '2022-12-14T19:00', '2022-12-14T20:00', '2022-12-14T21:00', '2022-12-14T22:00', '2022-12-14T23:00', '2022-12-15T00:00', '2022-12-15T01:00', '2022-12-15T02:00', '2022-12-15T03:00', '2022-12-15T04:00', '2022-12-15T05:00', '2022-12-15T06:00', '2022-12-15T07:00', '2022-12-15T08:00', '2022-12-15T09:00', '2022-12-15T10:00', '2022-12-15T11:00', '2022-12-15T12:00', '2022-12-15T13:00', '2022-12-15T14:00', '2022-12-15T15:00', '2022-12-15T16:00', '2022-12-15T17:00', '2022-12-15T18:00', '2022-12-15T19:00', '2022-12-15T20:00', '2022-12-15T21:00', '2022-12-15T22:00', '2022-12-15T23:00', '2022-12-16T00:00', '2022-12-16T01:00', '2022-12-16T02:00', '2022-12-16T03:00', '2022-12-16T04:00', '2022-12-16T05:00', '2022-12-16T06:00', '2022-12-16T07:00', '2022-12-16T08:00', '2022-12-16T09:00', '2022-12-16T10:00', '2022-12-16T11:00', '2022-12-16T12:00', '2022-12-16T13:00', '2022-12-16T14:00', '2022-12-16T15:00', '2022-12-16T16:00', '2022-12-16T17:00', '2022-12-16T18:00', '2022-12-16T19:00', '2022-12-16T20:00', '2022-12-16T21:00', '2022-12-16T22:00', '2022-12-16T23:00', '2022-12-17T00:00', '2022-12-17T01:00', '2022-12-17T02:00', '2022-12-17T03:00', '2022-12-17T04:00', '2022-12-17T05:00', '2022-12-17T06:00', '2022-12-17T07:00', '2022-12-17T08:00', '2022-12-17T09:00', '2022-12-17T10:00', '2022-12-17T11:00', '2022-12-17T12:00', '2022-12-17T13:00', '2022-12-17T14:00', '2022-12-17T15:00', '2022-12-17T16:00', '2022-12-17T17:00', '2022-12-17T18:00', '2022-12-17T19:00', '2022-12-17T20:00', '2022-12-17T21:00', '2022-12-17T22:00', '2022-12-17T23:00', '2022-12-18T00:00', '2022-12-18T01:00', '2022-12-18T02:00', '2022-12-18T03:00', '2022-12-18T04:00', '2022-12-18T05:00', '2022-12-18T06:00', '2022-12-18T07:00', '2022-12-18T08:00', '2022-12-18T09:00', '2022-12-18T10:00', '2022-12-18T11:00', '2022-12-18T12:00', '2022-12-18T13:00', '2022-12-18T14:00', '2022-12-18T15:00', '2022-12-18T16:00', '2022-12-18T17:00', '2022-12-18T18:00', '2022-12-18T19:00', '2022-12-18T20:00', '2022-12-18T21:00', '2022-12-18T22:00', '2022-12-18T23:00'], 'temperature_2m': [22.4, 21.8, 21.3, 21.0, 21.0, 20.8, 20.5, 20.4, 20.5, 20.5, 21.1, 22.4, 23.2, 23.3, 24.4, 25.6, 26.2, 26.2, 26.2, 24.5, 24.5, 23.8, 22.8, 22.3, 22.0, 21.4, 21.2, 21.1, 20.9, 20.7, 20.5, 20.6, 20.6, 20.8, 21.3, 21.8, 22.4, 23.1, 23.7, 25.4, 26.6, 23.9, 24.1, 23.8, 22.2, 21.8, 21.6, 21.4, 21.1, 21.0, 20.8, 20.5, 20.1, 19.8, 19.7, 19.6, 19.5, 19.8, 20.5, 21.3, 21.8, 22.3, 22.8, 24.0, 24.9, 24.9, 25.5, 25.6, 24.3, 22.9, 21.8, 21.3, 20.8, 20.3, 19.9, 19.7, 19.3, 18.7, 18.5, 18.2, 18.0, 17.9, 19.5, 21.0, 22.6, 24.4, 25.4, 26.5, 27.7, 28.0, 28.1, 27.9, 27.3, 26.1, 24.7, 22.9, 20.9, 20.3, 20.0, 19.8, 19.5, 19.2, 18.8, 18.4, 18.0, 18.2, 19.2, 20.9, 23.0, 24.5, 26.0, 27.3, 27.6, 27.4, 27.0, 26.8, 26.5, 25.7, 24.4, 22.8, 21.0, 20.4, 20.1, 19.9, 19.7, 19.5, 19.2, 18.7, 18.1, 18.2, 19.9, 22.4, 25.3, 26.5, 27.3, 28.1, 28.7, 29.1, 29.3, 29.0, 28.3, 27.2, 26.1, 24.9, 23.5, 22.9, 22.6, 22.1, 21.6, 20.9, 20.3, 20.0, 19.9, 20.3, 21.3, 22.7, 24.5, 25.7, 26.7, 27.8, 28.3, 28.6, 28.3, 27.4, 25.9, 24.2, 23.3, 22.6]}}
29+
30+
print(var)
31+
latitude = {var['latitude']}
32+
longitude = {var['longitude']}
33+
data = {var[{'hourly'}]}
34+
print(latitude, longitude, data)
35+
36+
37+
38+
39+
# arquivo proverbios
40+
# with open('arquivos/proverbios.txt', 'r', encoding="utf8") as arquivo:
41+
# proverbios = arquivo.readlines()
42+
# print(random.choice(proverbios))
443

544

645

0 commit comments

Comments
 (0)