Previous Topic

Next Topic

Book Contents

Book Index

RSS Export

Connect Daily allows exporting data in RSS 2.0 XML format. Using RSS export, you can get event data from your calendar and reformat it for display on your web site. For example, you want to have a list of today's events on the first page of your web site. Using the RSS module, you can fetch the calendar data as XML, reformat it, and display it on your web site. Doing this will require some knowledge of web programming topics. End users can also use news feed aggregation software to view your feed on their desktop.

Fetching RSS data from Connect Daily

The format of the RSS URL will be something like:

http://calendar.yourhost.name/[your path/]rss/[by method]/[id].xml

[your path] is the path to your calendar. If you are using a hosted calendar, then this part will be skipped.

[by method] is method you want to retrieve the entries by. Values would be:

[id].xml is the ID for the element you want to retrieve. The edit screen for the element (edit calendar, edit resource, etc) displays the ID you'll need to use.

Putting it all together, the URL to retrieve the Everything calendar from our demo site would be:

http://www.mhsoftware.com/caldemo/rss/calendar_id/34.xml

to retrieve the entries for the Pepsi Center, the URL would be:

http://www.mhsoftware.com/caldemo/rss/resource_id/3.xml

If you're doing Ajax or other programming you can request the URL:

http://www.mhsoftware.com/caldemo/rss/xxx/list.xml

where xxx is the element type, i.e., calendar_id, resource_id, resource_type_id, or item_type_id. List returns something like:

<?xml version="1.0" encoding="UTF-8" ?>
<list type_id="32768">
<item>
<id>40</id>
<name>College Football</name>
</item>
<item>
<id>20</id>
<name>Colorado Avalanche</name>
</item>
...

</list>

Additional Parameters

To control the returned data, you can specify additional settings on your request.

Parameter Name

Values

pubdate

0 - The pubdate element of the item entry will be the last update of the event. The event start/stop date will be placed in the event description entry.

If you specify pubdate=0, then the description will include the event start times for one time events, or the recurrence description for recurring events.

1 - Default. The pubdate element of the Item entry will be the event date time.

allow_duplicates

If this parameter is 1, then the RSS stream will come back with duplicate events. The default behavior is to return each event only one time in the feed regardless of how many times it occurs during the period the feed is returning.

start

Julian start date for events. If this value is present, then events from the start date forward are returned.

maxcount

Number. Maximum count of Item entries to return.

dayspan

Number of days of events to return. By default, the RSS export will return the number of days specified in the System configuration screen. Using this parameter, you can increase or decrease the number of days that events are returned for.

If this parameter is -1, then all one time or specific dates events in the candidate set (calendar, resource, etc) will be returned. This includes events that are in the past. Recurring events (other than specific dates) will not be included in the output set.

This parameter is ignored if newest is specified.

Regardless of how many times an event occurs during the specified period, the entry will only be returned one time.

newest

1 - If this value is specified, rather than returning the next dayspan days of events, the maxcount newest events will be returned. In other words, the maxcount most recently edited events will be returned.

rollup

0 - Don't roll up events from included calendars into this export.

1 - Default. Follow the option set at the calendar level for rollup.

show_resources

0 - Do not add resource names to event title.

1 - Add resource names to event title.

The default behavior if this argument is not specified is to follow the user's preference for Show Resources by Default.

username

password

If you want to use the feed from another program, and the feed requires a login to be visible, you can pass the user name and password as arguments. See the example below.

Examples

Retrieve the last 5 concerts added to the concert calendar.

http://www.mhsoftware.com/caldemo/rss/calendar_id/7.xml?newest=1&maxcount=5

Retrieve concerts for the next two weeks, up to a maximum of 12 concerts, omitting holidays rolled into the calendar.

http://www.mhsoftware.com/caldemo/rss/calendar_id/7.xml?dayspan=14&maxcount=12&rollup=0

Retrieve the concert calendar using the user name and password of demo/demo.

http://www.mhsoftware.com/caldemo/rss/calendar_id/7.xml?username=demo&password=demo

Custom Name Space

In addition to the standard RSS 2.0 elements, Connect Daily includes additional data elements for each event. The additional Items include event end time, contact name, last modified date, etc. For a complete list of additional fields and their meaning, refer to the URL below.

http://www.mhsoftware.com/cdailyModule.htm

RSS Formatting Tools

Here are some links to RSS formatting tools that you can use to incorporate the Connect Daily RSS feed into your site.

Scripting Method

Solutions

Microsoft IIS using ASP or .Net

ByteScout RSS2HTML.ASP script

The one issue with this script is that there is no caching of the generated output done. This means a fairly heavy duty server hit on each request. Before using it on a busy site, we would recommend adding caching to it. Caching could be as easy as saving the time stamp and the generated output on the IIS Application object.

http://bytescout.com/how_to_display_rss_using_asp.html

We have a copy of the source on our site at:

http://www.mhsoftware.com/bin/asp_rss2html.zip

Tele-Pro RSS Feed Class

We used their on-line testing page and confirmed that the code was able to read Connect Daily's XML feeds correctly.

http://www.tele-pro.co.uk/scripts/rss/rss_content_feed_class_dl.htm

PHP

Magpie RSS

This package is a PHP script for parsing an RSS feed. It worked with only minor effort to figure out. If you are using PHP, this is a good solution. The downside is that you can't SSI include a PHP page from inside a .HTML page; your page will have to have a .PHP extension.

http://magpierss.sourceforge.net/

Perl/CGI

RSS Display

We installed and tested this package in about ten minutes or so. We did have to install the XML::RSS and MD5 perl modules to make it work. When using this package remember that the max_items parameter to the CGI script will affect the number of items returned. Either edit the script, or pass an additional max_items parameter to the CGI script.

http://www.decafbad.com/twiki/bin/view/Main/RssDisplay

using the script, the call to include the script output would be something like:

<!--#include virtual="/cgi-bin/rss_display
?src=http://www.mhsoftware.com/caldemo/rss/calendar_id/34.xml
?dayspan=14&maxcount=32" -->

To do the call as a Server Side Include on Apache, you'll need to either:

  1. Have the file named .SHTML
  2. Have the server use the XBitHack On setting.
  3. For Apache, you can add:

    AddOutputFilter INCLUDES .htm
    AddOutputFilter INCLUDES .html

    to your server's configuration file.
Cold Fusion

ColdFusion 6/7 allow you to get RSS via <cfhttp> and then prse it using <cfxml>. ColdFusion 8 has a <cffeed> tag that takes a URL for the feed.

See Also

Exporting Data

Comma Separated Value/CSV

Internet Calendar (iCal RFC-5545) Export