#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>


Declare the SSID and the password of your WiFi network.
const char* ssid     = "Your_WiFi_Name";
const char* password = "Your_WiFi_Password";

const String WUNDERGROUND_API_KEY = "YOUR_ Wunderground_API_KEY";
const String WUNDERGROUND_COUNTRY = "NL";
const String WUNDERGROUND_CITY = "Eindhoven";
const String dataURL = "http://api.wunderground.com/api/"+WUNDERGROUND_API_KEY+"/conditions/q/"+WUNDERGROUND_COUNTRY+"/"+WUNDERGROUND_CITY+".json";
void setup() {
  Serial.begin(115200);
  delay(10);
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
  
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

}
void loop()
{
  if(WiFi.status() == WL_CONNECTED)
  {
      HTTPClient http;
      http.begin(dataURL);
      int httpCode = http.GET();

        if(httpCode > 0) {
            // HTTP header has been send and Server response header has been handled
            Serial.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == HTTP_CODE_OK) {
                String payload = http.getString();
                Serial.println(payload);
            }
        }       
  }
  delay(10000);
}
