Weather by Zip Code (US Only) from RSS Feed
ericmedley
Posts: 4,177
Here's a little NetLinx module I wrote to get weather from an RSS feed via Zip Code (US and US Territories only)
The deal on this one is that the .comm module follows the rules and is strictly for comm back and forth from the server. It does no UI functions or polling or preset storage. There is a sample UI module and TP File included that shows you how to use the .comm module. the moudle<>Main Program API documentation is also included. It's really pretty simple. You send it a zip code and it spits back all the weather data. You can control the rate at which it spits the data back to you and choose to use or ignore whatever you don't want to get from it.
It's free to use - but if you charge for it - please send me a little kick back. I've included my paypal account if you feel so moved.
Hit me up with any questions you may have.
cheers!
e
Link to the file at my FTP server http://www.drivehq.com/file/df.aspx/publish/emmp_band/RSS_Weather_Module
The deal on this one is that the .comm module follows the rules and is strictly for comm back and forth from the server. It does no UI functions or polling or preset storage. There is a sample UI module and TP File included that shows you how to use the .comm module. the moudle<>Main Program API documentation is also included. It's really pretty simple. You send it a zip code and it spits back all the weather data. You can control the rate at which it spits the data back to you and choose to use or ignore whatever you don't want to get from it.
It's free to use - but if you charge for it - please send me a little kick back. I've included my paypal account if you feel so moved.
Hit me up with any questions you may have.
cheers!
e
Link to the file at my FTP server http://www.drivehq.com/file/df.aspx/publish/emmp_band/RSS_Weather_Module
0
Comments
Yeah - that's really annoying, isn't it...
I edited the post and put a link to my ftp server so you can download it. I should just do a git repo or something.
That's good to know. Thanks! In my case I'm only looking at one city at a time for the whole system. I have made an array of the struct to handle more than one city simultaneously but have never ran into issues with it. I do only poll for new weather (preset 1) every hour. Hit limits as tight as once an hour seem a bit draconian if you ask me. I used to hit the old NOAA Telnet terminal server every 5 minutes and it didn't mind a bit.
I have tried using NOAA a few times but found it tended to be a bit kludgy. And their API is an API that was written by a team of engineers (See page 74 for explanation of therms for engineering team and engineer) who often use the definition of a term to define the definition of a term, thus causing an extraneous loop of thought (refer to appendix 3C on managing extraneous thought loops and it's companion article on our site) which made getting to the actual data (ref: White Paper 104523C-2 describing the purpose and use of 'actual data') rather difficult to implement.
Hey Vinning,
I've been kinda testing the connection rssweather.com to see if I can break it as you mentioned. Oddly, I have had no issues with it blocking me even with multiple requests. I re-wrote it to keep weather from 10 cities and it's dutifully kept them all current. Your statement about the block spurred my poor addled brain too recall an issue I ran into early on that I just wrote off on my part. But, I downloaded your module to peek at what you did and I wonder if it's the same issue.
I too (early on) ran into errors as you describe but wrote if off to how I was hitting the server. The first version was similar to yours in that I didn't do any of the web-browser preamble spoofing. I just hit the port with the "Get" and it seemed to work fine. But, I did get an occasional error that would persist. I didn't think that it might actually be the website blocking me. I put in the preamble spoof and it all went away.
I wonder if you might try doing the same to see if it stops blocking you.
I'm not even sure if that module I posted back in the day used zip codes or city codes that were originally required, I think the code I run uses zips but I don't know if the posted mod was ever updated.
The XML parser was weathering (see what I did there?) the little tweaks rssweather.net was doing. While they were rearranging some of their formatting of the web page, they were sticking to their guns on being totally XML 2.0 compliant. So, my spendy/verbose XML parser was hanging in there.
However, recently rssweather.net fell prey to the lusty siren song of the interweb fortune grabbers. Their site is now a click-bait ad-haunted site. They've changed their entire data delivery API.
I did a quick check and can probably salvage the code but it's going to take some time - a commodity I don't have a lot of right now. So, if/when I get 'round to it, I'll fix it and re-post it for y'all.
Sorry folks! It was a good run. We had a blast while it lasted.
After reading this I had to check mine since I haven't been receiving error emails, if my module doesn't get 10 of the 20 values it sends me an email with a copy of the entire reply from RSSWeather.com, I seem to be getting all the weather parameters but no forecasts. Now this is my system but I haven't received any emails from other systems so I assume they're all the same. The missing forecast would only represent 5 missing fields so no error email would be sent.
Now I think my parser doesn't depend on a fixed order of returned elements and I know in another module I wrote the returns were all screwed up when that device decided to update to Perl 5.18, I think, which decided to enforce perl radomization that was always in their spec but not used. That randomized the order of returns when prior everything had a fixed order for years so I originally coded for a known, fixed order. That really sucked but was fixable. I'll see if I can pinpoint the break in the forecast.
There was an error rendering this BBCode post
but in some deployments I use this newer version which does not work at all, just returns a bad format message: My jobs that use this format haven't been sending me errors because the returned string doesn't make it to my parser since there is no </rss> end tag and since it doesn't go to the parser it doesn't send an error.
still no forecasts.
E, what GET are you using, the wx.php? I don't see any adds on the rss.php page.
http://www.rssweather.com/zipcode/06810/rss.php
I actually don't see any here either:
http://www.rssweather.com/zipcode/06810/wx.php
SEND_STRING 0:WEATHER_PORT:0,"'GET /zipcode/23435/rss.php/ HTTP/1.1',13,10,'Host: www.rssweather.com',13,10,13,10";
Guys, it's not that the get command doesn't work. It works fine with a slight change. It's that the formatting of the XML coming back is totally jacked up. And I don't have time to do a complete rewrite right now. I will when I get a little time to do so.
Where:
I believe this was the original GET format from when I originally wrote this module so it may be only my later changes are not completely working, go figure. I don't think I've ever modified my original parsing. routine. It would be funny if I had to update my newer systems with older code.