Computing.Net > Forums > Web Development > Weather information on site

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Weather information on site

Reply to Message Icon

Name: ian_ok
Date: July 4, 2005 at 10:15:13 Pacific
OS: win xp 98 & 2k
CPU/Ram: p3 512
Comment:

I'm after finding out how to get a live data feed of weather on my website for a certain town or place.

Also it's not going to be any bigger than 103x50 pixels.

Thanks for any tips websites etc...

ian

Venta Sanlucar Sales



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: July 4, 2005 at 18:12:52 Pacific
Reply:

Weather.com has an XML feed. An excellent example of this uses openrico. Of course, you can format the data as you please.


0

Response Number 2
Name: ian_ok
Date: July 4, 2005 at 23:26:17 Pacific
Reply:

One other small problem I'm after the Weather being for BULGARIA.

Ian


Venta Sanlucar Sales


0

Response Number 3
Name: Bob (by BigBob)
Date: July 6, 2005 at 18:40:03 Pacific
Reply:

Try http://www.wunderground.com


" You're only as safe as your last update "


0

Response Number 4
Name: twodaend
Date: July 7, 2005 at 15:07:44 Pacific
Reply:

anonproxy:

Do you know how to use the weather section on your own page. I can't get it to work, but would like to. It looks really great.
http://openrico.org/demos.page?demo=ricoWeather.html

Thanks


0

Response Number 5
Name: anonproxy
Date: July 7, 2005 at 17:29:36 Pacific
Reply:

Last I checked, XMLHTTPRequest only works within one domain. So a page retrieved from one domain can only make requests to that domain. An html document (and corresponding javascript) retrieved from a local file cannot communicate with anything but the localhost. Neither can a page from, say your website, communicate with openrico.org.

I just downloaded and toyed with the example. Everything worked fine except for the data transfer. The example requires some server-side functionality to work.

Notice this function in the html:

function registerAjaxStuff() {
ajaxEngine.registerRequest( 'getWeatherInfo', 'getWeatherInfoHTML.do' );
//some other stuff here I deleted
//registers HTML and javascript containers

//this here is our GET variable
$('zip').onkeydown = handleEnterKey.bindAsEventListener($('zip'));

}

getWeatherInfoHTML.do is a file requested, through code in rico.js, to a server handler (they are using a Java servlet). This is typically how you would implement a service (i.e. dynamically).

I haven't looked at the rico code, but I can tell getWeatherInfoHTML.do is just a url, because using it as such calls a revealing error. We need arguments to call the URL, else it returns nothing useful. Notice in the code above the zip variable? That's the argument we need to call. Try it out.

So, to get the example to work, we need only modify the URL handling for ajaxEngine.sendRequest(). This is done in ajaxEngine.registerRequest(). Things would work fine, but we still have to cross-domain limitation.

The PDF documentation is helpful. I should have read that first ;).


0

Related Posts

See More



Response Number 6
Name: twodaend
Date: July 7, 2005 at 20:15:32 Pacific
Reply:

How do I modify the URL handling for the ajaxEngine.sendRequest(). I can get the page to show the input box and put in a zip, put nothign shows after that. It is not showing the weather for the zip I put in, just a blank area where the input field and button used to be. I don't know anything about javascript so this is all new to me.


0

Response Number 7
Name: anonproxy
Date: July 8, 2005 at 13:09:40 Pacific
Reply:

I don't think you understand how the library or XMLHTTPRequest works. I answered your question above. But you will still run into a snag, even if you change the request URL.

"...XMLHTTPRequest only works within one domain.". See my previous posts for why.

"The example requires some server-side functionality to work." Again, see the previous post. Finally, read the openrico.org documentation to see how the library works. You have all the code in front of you except for the Java request handler.



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Weather information on site

avi file to play on site www.computing.net/answers/webdevel/avi-file-to-play-on-site-/732.html

Appearing on search engines www.computing.net/answers/webdevel/appearing-on-search-engines/2812.html

Streaming Media Site www.computing.net/answers/webdevel/streaming-media-site/2967.html