weather

Using the Yahoo Weather API with JSON and the script tag

拜拜、爱过 提交于 2019-12-02 01:18:45
问题 I'm trying to get the Yahoo Weather with JavaScript. I originally made a proxy, but found that clumsy. So can get the JSON response from http://weather.yahooapis.com/forecastjson?w=9807, and I know that the script tag can avoid the same-domain restrictions, but I'm getting a syntax error. Yahoo's JSON response isn't padded; I've got the callback working but the browser isn't interpreting the JSON properly. I've seen many examples like How to read yahoo weather JSON data with Jquery ajax but

Google Weather API - parsing and modifying data

僤鯓⒐⒋嵵緔 提交于 2019-12-02 00:01:59
This question is no longer up-to-date -- Google shut down the unofficial weather API in 2012 I'd like to put some weather forecast to a friend's web page. When I address for http://www.google.com/ig/api?weather=koprivnica,croatia&hl=hr The browser returns the right content I'd like to parse to PHP with this code: <?php $xml = simplexml_load_file('http://www.google.com/ig/api?weather=koprivnica,croatia&hl=hr'); $information = $xml->xpath("/xml_api_reply/weather/forecast_information"); $current = $xml->xpath("/xml_api_reply/weather/current_conditions"); $forecast_list = $xml->xpath("/xml_api

Using the Yahoo Weather API with JSON and the script tag

£可爱£侵袭症+ 提交于 2019-12-01 21:48:57
I'm trying to get the Yahoo Weather with JavaScript. I originally made a proxy, but found that clumsy. So can get the JSON response from http://weather.yahooapis.com/forecastjson?w=9807 , and I know that the script tag can avoid the same-domain restrictions, but I'm getting a syntax error. Yahoo's JSON response isn't padded; I've got the callback working but the browser isn't interpreting the JSON properly. I've seen many examples like How to read yahoo weather JSON data with Jquery ajax but it's so weird because all those give me the cross-domain error. Can anyone help me with this? Cross

How to get Yahoo's woeid by location?

旧时模样 提交于 2019-11-30 14:28:07
// Get woeid by lati/long HttpGet hg = new HttpGet( "http://where.yahooapis.com/geocode?location=" + latlon + "&flags=J&gflags=R)"); HttpClient hc = new DefaultHttpClient(); HttpResponse weatherHR = hc.execute(hg); if (weatherHR.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { if (DEBUG) Utils.log("", "Location != HttpStatus.SC_OK"); return null; } I used this API and it work ok before, but It return a error since today, the HttpStatus.SC_OK is not OK. Has this API been closed? Thanks. Yes, it's closed, give a look here: http://soup.metwit.com/post/47181933854/an-alternative-to-yahoo

MSN weather API list of conditions?

僤鯓⒐⒋嵵緔 提交于 2019-11-30 10:42:50
问题 Microsoft has a weather API very similar to Google's (which now appears to be completely dead). I've converted one of my applications over to their feed, but I've been unable to find a list of all possible weather conditions. This is documented fairly well for Google's weather API, but I can't find a list of conditions for the MSN weather API. FWIW, an example URL to get data back using MSN is: http://weather.service.msn.com/data.aspx?weadegreetype=F&culture=en-US&weasearchstr=Chicago,IL

Weather web service for Europe? [closed]

穿精又带淫゛_ 提交于 2019-11-30 09:03:33
We are looking for a reliable "current weather" web service for Europe, with city resolution. We only need the current weather. Since it is for a commercial web site, we don't mind paying a reasonable fee for the service. What are our options? What service would you recommend or avoid based on previous experience? Note: SOAP Web Service, XML RPC, REST, all are fine. The US NOAA has coded METAR information available for cities worldwide. Given the ICAO airport code for the city in question (eg. EGLL for London) you can quickly get a METAR report. Weather Underground is a successful weather site

How to parse XML in JavaScript from Google

不羁的心 提交于 2019-11-30 07:52:34
问题 I want to parse this XML Document http://www.google.de/ig/api?weather=Braunschweig,%20Deutschland I want to be able to read out condition, temp_c and humidity. All this I want to do inside of JavaScript without using any server sided scripts such as PHP and I want it to work on modern browsers as well as IE7 and if without many problems IE6 EDIT: A solution without a framework would be ideal 回答1: Unless you are working on a page hosted on google.de — you can't. The same origin policy prevents

MSN weather API list of conditions?

為{幸葍}努か 提交于 2019-11-29 21:57:57
Microsoft has a weather API very similar to Google's (which now appears to be completely dead). I've converted one of my applications over to their feed, but I've been unable to find a list of all possible weather conditions. This is documented fairly well for Google's weather API, but I can't find a list of conditions for the MSN weather API. FWIW, an example URL to get data back using MSN is: http://weather.service.msn.com/data.aspx?weadegreetype=F&culture=en-US&weasearchstr=Chicago,IL (service not available anymore (Jan 2016)) Can anyone shed some light on the possible conditions? I need

How to get Yahoo's woeid by location?

余生长醉 提交于 2019-11-29 19:24:39
问题 // Get woeid by lati/long HttpGet hg = new HttpGet( "http://where.yahooapis.com/geocode?location=" + latlon + "&flags=J&gflags=R)"); HttpClient hc = new DefaultHttpClient(); HttpResponse weatherHR = hc.execute(hg); if (weatherHR.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { if (DEBUG) Utils.log("", "Location != HttpStatus.SC_OK"); return null; } I used this API and it work ok before, but It return a error since today, the HttpStatus.SC_OK is not OK. Has this API been closed? Thanks.

Reading a JSON reply from WeatherUnderground

江枫思渺然 提交于 2019-11-29 17:57:49
package test; import java.net.*; import java.io.*; import com.google.gson.*; import com.google.gson.stream.JsonReader; public class TestGson { URL callToApi; //------------------------------------------------------------------------------ public static void main(String[] args) { new TestGson(); } //------------------------------------------------------------------------------ public TestGson(){ try{ sendCallToApi(); readJson(); }catch(IOException e){ e.printStackTrace(); } } //------------------------------------------------------------------------------ public void sendCallToApi(){ try{