0
一段時間以來,我一直在使用Yahoo Weather API來獲取當前日溫度和C#中.Net應用程序的統計預測。 顯然雅虎更新了他們的api,應用程序無法獲取數據。如何升級到新的雅虎天氣API?
我使用XML文檔這樣得到的數據
XmlDocument doc = new XmlDocument();
doc.Load("http://xml.yahooapis.com/forecastrss?w=" + WOEID + "&u=c");
XmlNamespaceManager ns = new XmlNamespaceManager(doc.NameTable);
ns.AddNamespace("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0");
XmlNode nod = doc.SelectSingleNode("/rss/channel/link", ns);
link = nod.InnerText;
....more nodes selected....
像這樣我得到的XML節點和值,將其存儲在數據庫中。
我必須做出什麼改變才能使應用程序能夠使用新的api?