School closings

cdx11356

New Member
How about a script to read a web page and check for school cancellantions/delays?


I was working on a script that would run in the early morning and tell me if the kids school was cancelled or delayed but I ran into a problem where the data was'nt being returned. I was only getting the outer frame of the web page. Not sure why this happened.
 
Sure, tell me what the url is and I will see what I can do.

What I would do is write a script that dumps the data into a virtual device, then use my Super Trigger plugin to announce the value of that device if your school is one of the closed/delayed schools or I can just do all the parsing, so you can finish the script if desired, and no plugin requird, but the plugin lets you do all sorts of cool stuff without having to know scripting.

Let me know what you think about it.
 
I'll have to send it to you tonight. I've got the URL at home. You can get right at it, but the site does not have a link to it unless there is bad weather pending.

Pray for snow,
Chip
 
I wish there was a site on the net that monitored this for all school in the US, this script would be useful to many people.
 
I found this real quick. school closings
I agree that a national site would work for everyone. Apparently this site is free to join, but haven't looked at it yet. I'll look for other sites later on.
 
Doesn't look very good. Appears that local TV station websites are best choice. Maybe a "fill in the blank" kind of thing?
 
cancellations.com has my local school listed, which isn't big, so I am hoping they keep this updated. Local tv sites are usually the best solution, but the formatting is different for each site, so it's hard to write "a one size fits all" type of script. I will write the script using the url he will give me, but will monitor cancellations.com to see how they keep up.
 
electron,
here it is. Yes a national one would be nice, but I don't think realistic. I have looked at cancellations.com, but I think users will want to use one the feel is realiable for their community.


http://wfsb.meredith.com/data/sch.html

Chip


There is nothing on it now, but I've got a file with a couple of sample pages I pulled from them a while back when it snowed. How can I upload them for you?
 
you can either upload it as an attachment here, or email it directly to me ([email protected]). Are you planning on using my plugin? (check the downloads in the HA forum for super trigger), avoiding any more scripting, or do you want the script to handle the announcements? I definitely would appreciate the sample pages.
 
Chip- This is my very first shot at parsing and it is VERY LIMP. But should work for you.

Electron- PLEASE feel free to tear into for me. I smiled when it actually worked, but I also realise it's about as smooth as 40grit sandpaper ;)
 

Attachments

  • school_closings.txt
    576 bytes · Views: 44
I'm sorry, I forgot to post the script, I worked on it a few days ago. I will attach it to this post, make sure you disable (start the line with a ') the long strBody line if you want to actually use this, right now, it's in test mode, showing what it would do using the data you have given me. Do keep in mind that they might have changed the layout of the alerts by now, so if it doesn't work, try saving the source again and send it to me (or post here). You can specify which school to monitor in the script, and which device to update. If you don't want it to log updates, disable the hs.writelog statement in the update sub. Let me know how it works.

justonemore, I am glad to see my tutorial did what I wanted it to do, that would indeed show the school closings, good job! However, cdx emailed me with more details, and also wanted to monitor just one school for delays/closings, so I am goign to post my script, but do realize nothing is wrong with yours ;)
 

Attachments

  • school_alerts.txt
    8.7 KB · Views: 58
Thanks Electron. I'll d/l load yours as well and try to figure out some of the things that you did. A live learning example!
I already did another one for the temp from my local TV website. Was much quicker, and cleaner, the 2nd time.
Sat around work all day trying to figure out what else I could try to parse!
 
Ah now you are a parsaholic too! You will find plenty of stuff you can do, but the world can change around you. One big piece of advice: don't try parsing your wife ;)
 
Back
Top