Drop Shadow

RSS and other feeds

Data sharing is very important today. It allows people to download calendar information for their calendar software, their cell phones, or other applications, and it allows them to aggregate events and notices from different sources into a central area that is easy for them to find.

The autocalendar plug-in supports RSS feeds and icalendar feeds.

The easiest way to set up a feed is to make sure that your autocalendar setup lines are at the very top of your page. This allows autocalendar to handle feed requests automatically, or nearly so. The <? that starts your autocalendar stuff must be at the very top of your page. If there is any space, carriage return, text, or HTML in front of it, autocalendar can’t generate the web headers necessary to identify this as a feed.

For example, if you have a concert listing and want people to be able to subscribe to feeds, you might use the following:

<? //concert calendar and feeds $concerts = new sqliteautocalendar(); $concerts->open("/Users/me/databases/concerts"); $concerts->events("concerts", "eventdate", "eventtitle", "eventinfo"); $concerts->feed(); ?>

Whenever a user requests a feed, the “$concerts->feed();” line will intercept that request and give them the feed instead of the web page.

Later in the page, after you’ve started your HTML and in the spot where you want the monthly calendar to show up, you can put your weekly or monthly calendar in without having to duplicate the autocalendar setup:

<?$concerts->monthly(2);?>

Since the concert autocalendar has already been set up at the top of the page, all you need here is to tell the concerts to display themselves monthly, and that line will do it.

You also will want to announce that you have feeds available. Somewhere on your page, put:

<?$concerts->feeds();?>

This will put up a list of each of the feeds that autocalendar supports, and a link to that feed.

Additional feed information

Feeds often have additional information about the feed that accompanies the information about each event or item. You can add a title for your site, a link to your site, and a description of your site.

$concerts->sitetitle("Concerts by the Hay"); $concerts->sitedescription("These concerts are provided with funding from the institute for advanced musicology."); $concerts->sitelink("http://www.sandiego.edu/hayconcerts/");

If you don’t specify a site link, it will assume that the current page is the site link. It will also try to guess a useful title from the file path, but you will probably want to specify a title anyway.

If your events have a date when they were made public as well as an event date, you can provide that information. It will help feed readers display the information to your users.

$concerts->publishdate("added");

That line tells autocalendar that the field called “added” contains the date the information was published.

If you provide this additional information, make sure you tell autocalendar about it before the “->feed()” line.