Is this something of interest to anyone? I have some php code I dug up that does a scrape of weather.com. I've sinced wrapped it as a simple drupal module that displays in a block, but I'm wondering if it's worth anything to anyone else... well?

Comments

gerardryan’s picture

Thanks, that's motivational :o)

I'll clean up what I got... but where do I post it? Meh, I suppose I can just make it available off one of my sites....

ax’s picture

gerardryan’s picture

shane’s picture

I just installed and tested it out on my Drupal 4.2.0 system - works like a charm! Thanks!

mathew’s picture

nice module,but output warnings:(in 4.3.2)

warning: fopen(/website/html/modules/ZGGG.xml): failed to open stream: Permission denied in website/html/modules/weather.module on line 275.

warning: fwrite(): supplied argument is not a valid stream resource in website/html/modules/weather.module on line 276.

warning: fclose(): supplied argument is not a valid stream resource in website/html/modules/weather.module on line 277.

gerardryan’s picture

it's possible that you have to change permissions on your modules directory to allow for caching, but there have have been several improvements in the module in the most recent version. please let me know if you have further issues.

download current:
http://cvs.drupal.org/viewcvs/*checkout*/contributions/modules/weather/w...

weather cvs:
http://cvs.drupal.org/viewcvs/contributions/modules/weather/

thanks.

mathew’s picture

Done.
I download the cvs version, set it force no caching.It's woking now.

Thankyou.

gerardryan’s picture

thanks for your followup.

Vapor8’s picture

Check out http://www.rssweather.com/

You can get your weather data as an RSS feed... Then, it's as simple as whipping up some code built with Magpie (http://magpierss.sourceforge.net/) and you're all set...

8)

Vapor8

gerardryan’s picture

I recently found out the hard way that Weather.com will eventually block updates to an IP that repeatedly scrapes... oh well... it was dirty anyway.

Now I'm using an XML feed from www.weatherroom.com -- which means a complete re-write of the module, but it's going quickly.

gerardryan’s picture

this version nibbles off an XML feed from weatherroom.com.

download current:
http://cvs.drupal.org/viewcvs/*checkout*/contributions/modules/weather/w...

weather cvs:
http://cvs.drupal.org/viewcvs/contributions/modules/weather/

new version uses a 60 minute auto-caching feature for the XML feed if it detects that php safe mode is off.

feedback is welcome and appreciated. thanks.

gerardryan’s picture

weather module can now (optionally) fetch extended forecasts and display them to a page!
todo:
add image support

gerardryan’s picture

http://drupal.org/drupal/4.3.0/modules/weather-4.3.0.tar.gz

This is a significant performance increase over the XML caching option.