Click to See Complete Forum and Search --> : Weather Script


bradgrafelman
06-30-2005, 09:49 PM
Okay then... decided to write a PHP script that grabs weather data from an alternate source (with one site listed as a backup incase the primary site fails to connect), use some Perl REGEXP to grab the actual numbers, and output it in a format that I'd like.

Feel free to comment to the fullest extent... alternative methods, functions, etc.

dyntryx
07-06-2005, 02:31 AM
I didn't look through it too thoroughly, but from what I did see it looked excellent. I can't really think of any better way to go about doing it. I mean, the perl functions are fast, the data can be cached to save even more time, and it looked to me like it was working correctly when I tested it. I'd say it's rather fullproof. :p

bubblenut
07-10-2005, 10:09 AM
Cool, seems to work well. I would be wary about releasing this though. Lots of site owners don't like people scraping their sites and when you're dealing with the likes of Yahoo! they have the power to make your life very unhappy if they catch you (brown paper bag stuffed with cash will keep me quiet ;)). Also, the weather data isn't very usefull for me as I don't live in Glasford, it would be nice if you could make a wrapper for their form (and result data) to allow the user to select their area rather than edit the source of the file. This, however, would be taking site scraping to a whole new level.
It may well be easier to do this through a web service. I'm sure there are free webservices out there for getting weather data. In fact, a bit of googling showed up this (http://www.bindingpoint.com/services.aspx?tag=srch&val=weather&x=0&y=0).
If you choose to check out the web services option check out UDDI.org (http://www.uddi.org/find.html)

fixed your url - BuzzLY

bradgrafelman
07-11-2005, 08:24 PM
Well, see, I just made this script for my school's site. Yeah, I know about data scraping, but, I figure it's saving bandwidth and load time so I'm just going to give it a shot and see how it goes. I really didn't release this code for use, I was just hoping the gurus out there would review it and let me know if there were any tweaks here or there that I could apply.

As for free web service... I suppose I didn't search too hard because I just wanted another PHP script to be embedded into my school's website. Job security, you see. :D

Thanks for the reviews, guys. Keep 'em comming, especially if you would have done something differently (i.e. the regexp pattern, etc. etc.)!