I'm trying to get weather data from wunderground.com using my Arduino MKR1000 and display it (for now on the serial monitor, but in future on an OLED display), but I'm a bit stuck: how do I get the specific object/s from the page which contain/s the weather data? I already have an API key, and am using some code from Arduino.cc (Scheduled WiFi SSL Web Client by Arturo Guadalupi).
Here's the section of code I can't figure out the formatting for (the MKR1000 isn't connecting to the page and object I specified). Please tell me if you want the whole document.
if (client.connect(server, 443)) { //Am I using the right port
// Make a HTTP request:
client.println("GET //api/xxxAPI KEY HERExxxxxx/conditions/q/xLOCATION CODE HERExx.json HTTP/1.1\r\n"); //This is the line IDK how to format
client.println("Host: https://www.wunderground.com/weather/gb/xLOCATIONxx/xxSTATIONx");
client.println("Connection: close");
client.println();
}
else {
Serial.println("connection failed");
I'm trying to get weather data from wunderground.com using my Arduino MKR1000 and display it (for now on the serial monitor, but in future on an OLED display), but I'm a bit stuck: how do I get the specific object/s from the page which contain/s the weather data? I already have an API key, and am using some code from Arduino.cc (Scheduled WiFi SSL Web Client by Arturo Guadalupi).
The section of code I can't figure out the formatting for is around line 131 (the MKR1000 isn't connecting to the page and object I specified).
if (client.connect(server, 443)) { //Am I using the right port
// Make a HTTP request:
client.println("GET //api/xxxAPI KEY HERExxxxxx/conditions/q/xLOCATION CODE HERExx.json HTTP/1.1\r\n"); //This is the line IDK how to format
client.println("Host: https://www.wunderground.com/weather/gb/xLOCATIONxx/xxSTATIONx");
client.println("Connection: close");
client.println();
}
Hello, Mr. Server. I need some information. I'm not going to listen to a thing you say, so don't bother talking to me.