VAB Day Off - School Closings Application Documentation

The School Closings application provides and HTTP standards based GET request protocol for selecting a list of reported school closings and delays. The application allows users to submit filtering criteria and request the information returned as either xml or an html table embedded in a <div> element. All responses are returned in alphabetical order beginning with state then county then school. Application response content is intended to be used as either html content embedded into an existing or by applications which consume and transform xml content. This application is offered to Vermont Broadcasters by the Vermont Association of broadcasters. Please use this application responsibly. If you expect more than 100 hits per hour on this content please cash the response so that it refreshes every 30 seconds. For non-caching clients the Ajax implementation may be the best solution.

Contents
Usage Sample CSS for use with html table content Ajax Implementation Caching Queried Content A complete list of counties that may be reported Contact information

Usage
Sample Data
The parameter "sampledata=1" has been added to all the query string examples below to return sample data for testing. When you are ready to deploy be sure to remove this parameter so that you query the live data.

Return HTML Table No Filtering
http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&sampledata=1

returns (formatting has been handled by Sample CSS):
9:34:22 AM 10/26/2007 State County School Condition New HampshireCheshire testing a Really Really Long School IgnoreClosed New HampshireGrafton testing School 2 Ignore Closed New HampshireGrafton testing School 5 Ignore Closed Vermont Caledonia testing School long 6 Ignore Closed Vermont Chittenden aaaa test Closed Vermont Chittenden testing School 3 Ignore Closed Vermont Lamoille testing School 1 Ignore Closed Vermont Washingtontesting School Longer 7 Ignore Closed Vermont Windham testing School 4 Ignore Closed

For Ajax Client — Return HTML Table No Filtering
http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&returnajax=1&sampledata=1 Returns same as above but with xml content headers for the Ajax consumer.

Return XML Document No Filtering

http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=xml&sampledata=1 OR http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi?returnajax=1&sampledata=1

Returns XML document:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <!DOCTYPE listofschools > <listofschools> <reporttime>9:34:22 AM10/26/2007</reporttime> <reported> <row odd="1"><state>New Hampshire</state><county>Cheshire</county><school>testing a Really Really Long School Ignore</school><condition>Closed</condition></row> <row odd="0"><state>New Hampshire</state><county>Grafton</county><school>testing School 2 Ignore</school><condition>Closed</condition></row> <row odd="1"><state>New Hampshire</state><county>Grafton</county><school>testing School 5 Ignore</school><condition>Closed</condition></row> <row odd="0"><state>Vermont</state><county>Caledonia</county><school>testing School long 6 Ignore</school><condition>Closed</condition></row> <row odd="1"><state>Vermont</state><county>Chittenden</county><school>aaaa test</school><condition>Closed</condition></row> <row odd="0"><state>Vermont</state><county>Chittenden</county><school>testing School 3 Ignore</school><condition>Closed</condition></row> <row odd="1"><state>Vermont</state><county>Lamoille</county><school>testing School 1 Ignore</school><condition>Closed</condition></row> <row odd="0"><state>Vermont</state><county>Washington</county><school>testing School Longer 7 Ignore</school><condition>Closed</condition></row> <row><state>Vermont</state><county>Windham</county><school>testing School 4 Ignore</school><condition>Closed</condition></row> </reported> </listofschools>

Filtered Response
Filtering parameters may be appended to any of the above GET requests to limit the list of schools returned by the application. The fields which may be filtered are state, county, and school name. Values submitted may be used to include or exclude from the complete list of reported delays and closings. Schools do not appear on the complete list until they have been reported by school administrators. Multiple values for a given parameter are delimited by hyphens. Parameters are case sensitive but values are not. White space in parameter values is ignored. Parameters may be used in combination such as include a state but exclude a county. Filtering will use the most restrictive combination of parameters but all parameters may not be required. For example if looking for schools in Essex County Vermont it may be necessary to include the state parameter because New York also has an Essex County. However, no state parameter would be required when filtering for Lamoille County schools because there is only one Lamoille County in the New Hampshire, New York and Vermont. The application does not make up for human stupidity. Queries such as exclude Vermont and include Chittenden County will return nothing. Asking to include a misspelled parameter value such as include VermAnt will also return nothing. See the complete list of counties for help with possible parameter values. Caveat: Users should not rely on selections by school name. While this functionality is supported, the name of individual schools may change dependending on their condition or if all schools in a county are closed the report may simply list

"All Schools" rather than listing all the individual schools. To include states: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont-newhampshire To exclude states: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2exclude=vermont http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2exclude=New Hampshire-verMont To include Counties: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont&counties2include=washington http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2exclude=newhampshirenewyork&counties2include=essex-washington-lamoille To exclude Counties: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont&counties2exclude=rutland http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2exclude=New Hampshire&counties2exclude=grand Isle-Franklin To include Schools: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&include=harwoodunionhighschool http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont&counties2include=washington&schools2include=harwoodunionhighschoolthatcher brook elementary To exclude Schools: http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2include=vermont&counties2include=washington&schools2exclude=harwoodunionhighschool http://www.vabdayoff.com/cgi-bin/schoolclosings.cgi? returnbody=htmltable&states2exclude=New Hampshire&counties2exclude=grand Isle-Franklin&schools2exclude=miltonelementary Caveat: Users should not rely on selections by school name. While this functionality is supported, the name of individual schools may change dependending on their condition or if all schools in a county are closed the report may simply list "All Schools" rather than listing all the individual schools.

Ajax Implementation
Ajax will be the most desirable method of bringing the school closings content to your site because the backend server which processes these requests is a bit elderly and your users don't want to wait. This is the best alternative for non-caching clients. To use the Ajax script placement of the content on your page you include the Ajax java script in the head section of your html document: <script src="http://www.vabdayoff.com/cgi-bin/vabdo_ajax.js"></script><!-- Script containing sample Ajax implementation --> <script type="text/javascript"> window.onload = function() { //call to grab school closing data once document has loaded getVabDayOff('','','returnbody=htmltable&returnajax=1'); } </script>

The onload function is created to handle multiple function calls in case there are other calls which need to be made when the onload event is fired. The request for the school data in made with the call: getVabDayOff('','','returnbody=htmltable&returnajax=1'); The first and second params should remain empty. The third parameter will contain the parameters for your query string GET request. You may append as many as you need. For example: getVabDayOff('','','&states2include=vermont&counties2include=washington&schools2include=harwoodunionhighschoolthatcher brook elementary'); Your page must contain a <div> element with the id attribute of "vabdayoffarea". The response content will be placed within the <div> element. The table below is loaded using the Ajax call. View the source of this page and the Ajax script to see how the Ajax implementation works. waiting for Ajax data...

Caching Queried Content
For sites with a significant amount of traffic — more than 100 hits per hour — (you know who you are), we ask that you play nice and cache your queried content. If every parent wakes up in Chittenden County at 6:30 am to two feet of new snow and logs onto their favorite news website at 6:35 am and those websites have not cached the data, the school closings server will probably fail. So, it is in everyone's interest to play nice. For sites without an existing caching implementation, below is possible caching solution. Schedule a page or application to call the vab server with your query parameters every 30 seconds. Write the response to a file. Have the page that users view read its school closing information from that file. That way there will be a maximum of 200 requests per minute on the VAB server instead of 2,000.

Complete List of Counties
Below is a complete list of counties which may be reported. Counties do not appear on the list unless they have been reported by school administrators. NOTE: School names are not included because selecting by school name is unreliable. The way the name of the school is reported may change depending on the reported condition of the school. Also the school name may not even be listed if all schools in the county are closed. State New Hampshire New Hampshire New Hampshire New Hampshire New York New York New York Vermont Vermont Vermont Vermont Vermont Vermont County Coos Cheshire Grafton Sullivan Clinton Essex Washington Addison Bennington Caledonia Chittenden Essex Franklin

Vermont Vermont Vermont Vermont Vermont Vermont Vermont Vermont

Grand Isle Lamoille Orange Orleans Rutland Washington Windham Windsor

Contact
Contributions to this document and bug notifications are welcome. Please contact Alec Brecher with your comments and contributions.