![]() %20ak%22)&format=json&env=store%3A%2F%%2Falltableswithkeys Let’s look at the URL, for retrieving weather conditions and forecasts, you can find it at the bottom of this Yahoo Weather Developer page: Making a URL to retrieve Yahoo Weather Forecasts XML has caused me enough headaches in the past, so I’m trying to avoid that one. I choose JSON in my unit, since JSON works smooth and has little overhead. We also see that information can be retrieved as JSON data or as XML data. The returned answer, “woeid”, will then be used in the main query to retrieve the weather forecast, where the location ID (woeid) that came from our subquery, matches the location ID (woeid) of the weather.forecast table. Here we get the forecast for Nome, AK (USA), but we let Yahoo figure out what the ID is for that town by doing a subquery: forecast WHERE woeid IN ( SELECT woeid FROM geo. ![]() If you’re familiar with SQL, then this should look familiar: Once you know how this works, it’s actually pretty simple, but isn’t that with most things? SQL Like Weather QueryĪs you can see on this Yahoo Weather Developer Network page, a SQL like query can be used to retrieve weather information. ![]() As long as Yahoo provides this service, weather conditions and forecasts can be retrieved through their Yahoo Weather API. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |