2013-06-28 106 views
0

我一直狩獵左右,但我有這個掙扎,我想從雅虎天氣XML 5天的天氣預報,即時通訊試圖挑選以下數據:C#雅虎天氣API5天預測

/description> 
yweather:forecast day="Thu" date="27 Jun 2013" low="51" high="60" text="Partly Cloudy" code="29"/> 
yweather:forecast day="Fri" date="28 Jun 2013" low="45" high="59" text="Rain" code="12"/> 
yweather:forecast day="Sat" date="29 Jun 2013" low="52" high="58" text="Mostly Cloudy" code="28"/> 
yweather:forecast day="Sun" date="30 Jun 2013" low="49" high="62" text="PM Showers" code="39"/> 
yweather:forecast day="Mon" date="1 Jul 2013" low="48" high="61" text="Partly Cloudy" code="30"/> 

我可以從第一行獲取數據,yweather:forecast day =「thu」date =「2013年6月27日..........

但我無法弄清楚如何從任何其他行,日=「星期五」,坐,太陽

任何幫助非常感謝

歡呼聲

+0

這將幫助,如果你表現出你正在使用的數據拉代碼。 – Kixoka

+0

'Temperature = channel.SelectSingleNode(「item」)。SelectSingleNode(「yweather:condition」,manager).Attributes [「temp」]。Value; Condition = channel.SelectSingleNode(「item」)。SelectSingleNode(「yweather:condition」,manager).Attributes [「text」]。Value;代碼= channel.SelectSingleNode(「item」)。SelectSingleNode(「yweather:condition」,manager).Attributes [「code」]。Value。 – Birdog

+0

第一次發佈,仍然習慣於格式化,apoliogies – Birdog

回答

1

也許你可以嘗試一個API與一個甜蜜的JSON響應?

我會建議Metwit weather API
這是一個易於使用的完全REST API,它可以自由使用,用於許多合理的用途。

到這裏看看:http://soup.metwit.com/post/47181933854/an-alternative-to-yahoo-weather-api

最後但並非最不重要的,你可以實現它們的客戶端:200請求/天(基於IP的限制),無需任何身份驗證。
免費使用限制設置爲每個IP 200個請求,每個訪客可以請求每天200次!

(全面披露:我Metwit的創始人隨意問我進一步的細節)

+0

好的API它甚至沒有token.Thanks分享。 –