Python Scripts: Difference between revisions
→Bulk Upload Parameters
Line 1,031:
addr = socket.getaddrinfo('api.openweathermap.org', 80)
s.connect(addr[0][4])
s.send(b'GET http://api.openweathermap.org/data/2.5/weather?q=Bangalore&units=metric&appid=
html = s.recv(1000)
s.close()
Line 1,053:
print("Data Fetched @",ctime,":","Temp(C)=",temp,"\xb0C","Press(hPa)=",pres,"Hum(%)=",hum,"Vis(Km)=",vis,"Speed(m/s)=",speed,"Dir(deg)=",dir)
# Upload Temperature Data to thingspeak.com
payload = {"write_api_key":"
url = 'https://api.thingspeak.com/channels/396314/bulk_update.json'
headers = {'content-type': 'application/json'}
|