The DataFeed feature of the Penn Calendar allows users to retrieve data from Penn Calendar and incorporate it with their own web-site.
The DataFeed types are:
The arguments available for the DataFeed are the same as for the Penn Calendar
- XML 1.0 (default)
- RSS 0.91
- RSS 2.0
- iCalendar 2.0 (a.k.a. iCal)
- Tab delimited file
For example, to display today's Exhibitions:
Or, to display an individual owner's events:
Another example, to display events from more than one owner (aggregate owner):
DataFeed also includes one feature not directly available in the Penn Calendar.
showndays (show n day(s))
showndays allows the user to specify how many upcoming days to display, including the current day. For example, to display a week's worth of events, the associated URL would be:
showndays can also be used with the month,day, and year attribues to display a historical view of past events. The following example displays events from the first week of September 2001:
showndays and ownernames can be combined together to create custom views. For example, to display a week's worth of events for a specific owner, the associated URL would be:
Use of DataFeed
Use of DataFeed assumes that the user has a rudimentary knowledge of how to use the format being exported. For high-volume sites it is recommended that DataFeed be queried no more than once an hour.
The following sample code is provided as a starting point for incorporating DataFeed data. Please feel free to submit your own examples to firstname.lastname@example.org to be included on this page.
XML provides flexibility for incorporating Penn Calendar data. Server-side applications ASP, .NET, Python, Perl, PHP, ColdFusion, JSP, etc.. are all capable of parsing XML data.
The following PHP code will dynamically retrieve data from the Penn Calendar. Please note that this may cause page load delays as the data is retrieved. This is example code only. For a high volume site it is not recommended that you use this script to load the data, because it will exert a large load on the Penn Calendar. Instead a script that retrieves the XML export at set intervals is recommended.
Based on XML this format provides a "stripped down" export of Penn Calendar data.
Based on RSS 2.0 specification this format provides a "stripped down" export of Penn Calendar data. RSS 2.0 is compatible with newer RSS readers (i.e. Mozilla's Firefox web browser)
This format (sometimes refered to as ".ics") is recognized by many popular calendaring programs including MS Outlook and Apple iCal. Individual events may be imported or subscribed to. Please see your calendaring programs documentation to determine compatibility with the Penn Calendar iCalendar 2.0 Data Feed.
TAB Delimited File:
Simple tab delimited file, useful for importing into various programs.
Simple formatting in HTML. Suitable for use with hand-held devices.
For web providers hosted on www.upenn.edu ONLY
Calendar can be included on a pages hosted on www.upenn.edu by adding:
<!--#include virtual="/cgi-bin/calendar/calendar?view=datafeed&type=ssi" -->
to the HTML source of a webpage located on www.upenn.edu