Unity: Real life Weather / Website information

I need help getting my standalone application to detect what the weather is. I thought of 2 theory’s which i could do, but i don’t know how to do it.

  1. Is there a Weather.Now function? Just like TheTime.Now.Day; but for weather?

  2. If there isn’t a .Now statement for weather is there a way which i could use WWW to gather a string of information from a website e.g. I use the website Google but i want to get the temperature information from it, is that possible?

Thanks

Yes, you can use something like that:

or any other weather data provider…

then use Unity - Scripting API: WWW to get the data and parse it, so you can use it.

Fixxed it @Waldy

Blockquote

using UnityEngine;
using System.Collecstrong texttions;
using System.Xml;
using System;


public class ReadXml : MonoBehaviour {
    IEnumerator Start()
    {
        
        string url = "http://api.openweathermap.org/data/2.5/find?q=London&type=accurate&mode=xml&lang=nl&units=metric&appid=bd82977b86bf27fb59a04b61b657fb6f";
        WWW www = new WWW(url);
        yield return www;
        if (www.error == null){
        
            Debug.Log("Loaded following XML " + www.data);
           XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(www.data);
            Debug.Log("City: " + xmlDoc.SelectSingleNode("cities/list/item/city/@name").InnerText);
            Debug.Log("Temperature: " + xmlDoc.SelectSingleNode("cities/list/item/temperature/@value").InnerText);
            Debug.Log("humidity: " + xmlDoc.SelectSingleNode("cities/list/item/humidity /@value").InnerText);
            Debug.Log("Cloud : " + xmlDoc.SelectSingleNode("cities/list/item/clouds/@value").InnerText);
            Debug.Log("Title: " + xmlDoc.SelectSingleNode("cities /list/item/weather/@value").InnerText);
        }
        else
        {
            Debug.Log("ERROR: " + www.error);
  
        }

    }

  
}