Technology at Geneseo Community School District 228
On the district website http://www.dist228.org and the high school website http://www.dist228.org/index.php?page=hs/index.html – There are sections of the page where I have replaced the text with self updating information based on RSS 2.0 Feeds. The concept is simply so that the data in the fields will auto update when the user posts to their own website making it easier to get info on the main page quickly. In the case of the High School page I have modified this approach slightly and made it so a RSS feed of three combined ICS (Created on ICAl) calendars appears for the current day. Since Parsing three large ICS files is time consuming I have this Calendar RSS feed cached locally on the hour (will probably change to a 1 day interval). The effect is nice and in the long run time saving – allowing users who maintain the calendars or administrators who make messages to simply continue in their usual fashion and have the data auto update.
In the screenshot below I circled the two regions that are actually just displayed RSS feeds. With the Today’s Events Calendar I am using the same concept but decided to use an iFrame and make the php script a separate file – no real reason for this and may change it back to a call from within the existing php file.
Many of the Staff at Geneseo CUSD 228 have locally hosted websites that use the WordPress engine – one nice feature of using wordpress is that the site is already structured around an RSS 2.0 feed. Using a php RSS parsing script makes it easy to capture this information – the effect kind of a self-updating widget.
No need to reinvent the wheel on using PHP to capture or display RSS. Looking around on the web I cam across the RSSLIB – which contains a series of php scripts that handle most of the functions you can think of. For the most part I just cut code out of these files RSSCache.php and RSSlib.php to embed the functionality on the website.
Embedding the Today’s events calendar was a little more complicated since the files are actually all ICS Calendar files created in iCal. Here I have the calendars published to a local webdav server and then I have setup a PHP calendar site that parses and views these files. To view the ICS calendars on the web I used the http://phpicalendar.net/ beta build as a template and modified it for our purposes. Phpicalendar is able to remotely view a webdav hosted ICS file and further parse the data and construct a RSS feed from this data. This is excellent since using phpicalendar’s RSS Viewer and combining them with our 3 main HS calendars works perfectly except for time. Since these calendars are large it takes the PHP engine awhile to process – here is where I rely on the RSSLIB’s RSS cache script. RSScache simply creates a php dummy file of the most recent combined RSS feed and then holds it for an hour (will change to 12 hour or day soon). This speeds up the page loading time tremendously.
Here is a snippet of code used to view cached version of RSS feed.
(Update: I actually changed the “G” with a “d” so that it looks at the day instead of the hour when deciding to update cache this change adjusts the cache file every 24 hours instead of every 60 minutes)