Correct WOE but Weather says "City not found"
I'm having some problems retrieving weather info for Singapore.
1. First I retrieved "Singapore"'s WOE id -- which is 23424948
$ curl 'http://where.yahooapis.com/v1/places.q(Singapore)?appid={SECRET}'
<?xml version="1.0" encoding="UTF-8"?>
<places xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="1" yahoo:total="2"><place yahoo:uri="http://where.yahooapis.com/v1/place/23424948" xml:lang="en-US"><woeid>23424948</woeid><placeTypeName code="12">Country</placeTypeName><name>Singapore</name><country type="Country" code="SG">Singapore</country><admin1></admin1><admin2></admin2><admin3></admin3><locality1></locality1><locality2></locality2><postal></postal><centroid><latitude>1.365580</latitude><longitude>103.827713</longitude></centroid><boundingBox><southWest><latitude>1.115800</latitude><longitude>103.618248</longitude></southWest><northEast><latitude>1.470620</latitude><longitude>104.408470</longitude></northEast></boundingBox></place></places>
2. Then I requested for weather information using 23424948 -- which Yahoo replies with "City not found"
$ curl 'http://weather.yahooapis.com/forecastrss?w=23424948'
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Error</title>
<description>Yahoo! Weather Error</description>
<item><title>City not found</title><description>
Invalid Input /forecastrss?w=23424948
</description></item></channel></rss><!-- api8.weather.sp1.yahoo.com uncompressed/chunked Thu Feb 18 18:13:08 PST 2010 -->
3. I tried with New York's WOE ID -- 2459115, which basically works.
$ curl 'http://where.yahooapis.com/v1/places.q(New%20York%20City)?appid={SECRET}'
<?xml version="1.0" encoding="UTF-8"?>
<places xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="1" yahoo:total="1"><place yahoo:uri="http://where.yahooapis.com/v1/place/2459115" xml:lang="en-US"><woeid>2459115</woeid><placeTypeName code="7">Town</placeTypeName><name>New York</name><country type="Country" code="US">United States</country><admin1 type="State" code="US-NY">New York</admin1><admin2></admin2><admin3></admin3><locality1 type="Town">New York</locality1><locality2></locality2><postal></postal><centroid><latitude>40.714550</latitude><longitude>-74.007118</longitude></centroid><boundingBox><southWest><latitude>40.495682</latitude><longitude>-74.255653</longitude></southWest><northEast><latitude>40.917622</latitude><longitude>-73.689484</longitude></northEast></boundingBox></place></places>
$ curl 'http://weather.yahooapis.com/forecastrss?w=2459115'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - New York, NY</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html</link>
<description>Yahoo! Weather for New York, NY</description>
<language>en-us</language>
<lastBuildDate>Thu, 18 Feb 2010 8:51 pm EST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="New York" region="NY" country="United States"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="28" direction="280" speed="10" />
<yweather:atmosphere humidity="52" visibility="10" pressure="29.69" rising="1" />
<yweather:astronomy sunrise="6:46 am" sunset="5:34 pm"/>
...
</item>
</channel>
</rss><!-- api7.weather.sp1.yahoo.com uncompressed/chunked Thu Feb 18 18:15:07 PST 2010 -->
I'm not sure what's wrong with the Singapore data?
by
9 Replies