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.
You can download the rsslib php files here
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)
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Until now no comments