Ich weiß, diese Art von Fragen vor gefragt sind ... aber ich kann es herausfinden ... Ich mag dieses OS Fragen gelesen haben link1 und link2Cant erhalten Temperatur in Grad Celsius
Nun, ich eine Wettervorhersage App entwickle und dafür benutze ich yahoo weather api.
Ich benutze diese URL für Antwort
String url = "https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid="+woeid+
" and u='c'&format=xml&env=store://datatables.org/alltableswithkeys";
url = url.replace(" ","%20");
und ich erhalte diese Antwort
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="1" yahoo:created="2016-03-25T12:45:44Z" yahoo:lang="en-US">
<results>
<channel>
<yweather:units
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
distance="mi" pressure="in" speed="mph" temperature="F"/>
<title>Yahoo! Weather - Ahmedabad, GJ, IN</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2295402/</link>
<description>Yahoo! Weather for Ahmedabad, GJ, IN</description>
<language>en-us</language>
<lastBuildDate>Fri, 25 Mar 2016 06:16 PM IST</lastBuildDate>
<ttl>60</ttl>
<yweather:location
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
city="Ahmedabad" country="India" region=" GJ"/>
<yweather:wind
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
chill="99" direction="315" speed="11"/>
<yweather:atmosphere
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
humidity="20" pressure="1003.0" rising="0" visibility="16.1"/>
<yweather:astronomy
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
sunrise="6:38 am" sunset="6:53 pm"/>
<image>
<title>Yahoo! Weather</title>
<width>142</width>
<height>18</height>
<link>http://weather.yahoo.com</link>
<url>http://l.yimg.com/a/i/brand/purplelogo//uh/us/news-wea.gif</url>
</image>
<item>
<title>Conditions for Ahmedabad, GJ, IN at 05:30 PM IST</title>
<geo:lat xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">23.030809</geo:lat>
<geo:long xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">72.591751</geo:long>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2295402/</link>
<pubDate>Fri, 25 Mar 2016 05:30 PM IST</pubDate>
<yweather:condition
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="30" date="Fri, 25 Mar 2016 05:30 PM IST"
temp="98" text="Partly Cloudy"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="28" date="25 Mar 2016" day="Fri" high="98"
low="74" text="Mostly Cloudy"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="30" date="26 Mar 2016" day="Sat" high="101"
low="77" text="Partly Cloudy"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="32" date="27 Mar 2016" day="Sun" high="100"
low="76" text="Sunny"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="30" date="28 Mar 2016" day="Mon" high="101"
low="71" text="Partly Cloudy"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="34" date="29 Mar 2016" day="Tue" high="103"
low="71" text="Mostly Sunny"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="32" date="30 Mar 2016" day="Wed" high="102"
low="73" text="Sunny"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="32" date="31 Mar 2016" day="Thu" high="99"
low="75" text="Sunny"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="34" date="01 Apr 2016" day="Fri" high="97"
low="73" text="Mostly Sunny"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="26" date="02 Apr 2016" day="Sat" high="99"
low="76" text="Cloudy"/>
<yweather:forecast
xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0"
code="26" date="03 Apr 2016" day="Sun" high="101"
low="80" text="Cloudy"/>
<description><![CDATA[<img src="http://l.yimg.com/a/i/us/we/52/30.gif"/>
<BR />
<b>Current Conditions:</b>
<BR />Partly Cloudy
<BR />
<BR />
<b>Forecast:</b>
<BR /> Fri - Mostly Cloudy. High: 98Low: 74
<BR /> Sat - Partly Cloudy. High: 101Low: 77
<BR /> Sun - Sunny. High: 100Low: 76
<BR /> Mon - Partly Cloudy. High: 101Low: 71
<BR /> Tue - Mostly Sunny. High: 103Low: 71
<BR />
<BR />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Country__Country/*https://weather.yahoo.com/country/state/city-2295402/">Full Forecast at Yahoo! Weather</a>
<BR />
<BR />
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)
<BR />
]]></description>
<guid isPermaLink="false"/>
</item>
</channel>
</results>
</query>
als Antwort ... Ich bin nicht Temp immer in Celsius ... plese help me
nur Leerzeichen mit "% 20" ersetzen kann nicht genug sein: eine ordnungsgemäße 'UrlEncode' – dlatikay
Ich habe versucht, dass auch ... aber kein Glück –
schwierig zu reproduzieren, gibt der Anruf eine HTTP-Antwort 400 die meiste Zeit zurück : Unter https://developer.yahoo.com/weather wird angegeben, dass der öffentliche Endpunkt, den Sie verwenden, https://query.yahooapis.com/v1/public, seit dem 15. März 2016 nicht mehr unterstützt wird und jetzt angezeigt wird erzwinge OAuth an einer anderen Adresse. – dlatikay