iCal for Events Calendar

I coded a plugin for WordPress called iCal for Events Calendar. It creates an iCalendar feed for the Events Calendar plugin.

13 Responses to “iCal for Events Calendar”

  1. jerome says:

    Hi Mark – didn’t find any way to get in touch.
    just wanted to say thanks for putting a link to the page on Capacity (i updated it to link to your project on wordpress/plugin).

    It’s really nice to see this thing evolving and serving others.
    Great!

  2. Heirem says:

    However, discovering the plugin iCal for Events-Calendar, hoping to find more explanations on this blog ;)
    Best regards

  3. Heirem says:

    (sorry for the website url error)
    You’r wrong !
    However, discovering the plugin iCal for Events-Calendar, hoping to find more explanations on this blog ;)
    Best regards

  4. Mark says:

    Jerome: I tried to email you beforehand, glad you approve of the use.

    Heirem: The plugin pretty much does what it says, creates an iCalendar format feed from the Events Calendar database. The code is pretty simple and you can look at and use it if you think it should be a standard include.

  5. Tobias says:

    Hi,
    this is a great plugin and exactly what I was looking for. I just modified it a bit to also output the Location Field. Here is the patch:

    diff -pur ical-for-events-calendar/ical-ec.php ical-for-events-calendar+location/ical-ec.php
    — ical-for-events-calendar/ical-ec.php 2009-01-30 22:22:10.000000000 +0100
    +++ ical-for-events-calendar+location/ical-ec.php 2009-02-14 04:05:00.000000000 +0100
    @@ -72,6 +72,7 @@ function iCalFeed()
    $eventStart = date(“Ymd\THis”, $convertedStart) . “Z”;
    $eventEnd = date(“Ymd\THis”, $convertedEnd) . “Z”;
    $summary = $post->eventTitle;
    + $location = $post->eventLocation;
    $description = $post->eventDescription;
    $description = str_replace(“,”, “\,”, $description);
    $description = str_replace(“\\”, “\\\\”, $description);
    @@ -84,6 +85,7 @@ function iCalFeed()
    $events .= “DTSTART:” . $eventStart . “\n”;
    $events .= “DTEND:” . $eventEnd . “\n”;
    $events .= “SUMMARY:” . $summary . “\n”;
    + $events .= “LOCATION:” . $location . “\n”;
    $events .= “DESCRIPTION:” . $description . “\n”;
    $events .= “END:VEVENT\n”;
    }

    Perhaps you can include it in an upcoming version;-).

  6. Franz says:

    Dear MArk,

    tks for the plugin. It does a good job. So , I’m missing some crucial data. Haven’t you included options for Links and Locations be included in the iCal file as well?

    If yes, how difficult will it be for me to modify? I have some principal knowledge of how to read and edit here and there a php script but that’s it.

    Will that do?

    Tks for your answer in advance!
    Franz

  7. Jerrad says:

    Hello,

    This is a very promising addition to the Events Calendar, however, it does not emit valid iCal. Any newlines in an event description need to be turned into \n, and ideally control characters would be removed. If you do no escape newlines, google calendar’s strict parser cannot handle the resulting feed.

  8. Jerrad says:

    P.S. Why report (long) past events in the feed? Perhaps a setting to set the cut-off? This would help cut down on bandwidth of ical fetches for active calendars.

  9. Jerrad says:

    Use the following instead of comment 44:

    Hello,

    This is a very promising addition to the Events Calendar, however, it does not emit valid iCal. Embedded newlines should be escaped, and long lines need to be folded (per RFC 2445) in chunks of 75 characters or less followed by CRLF and a whitespace character (I recommend tab). Improperly formatted feeds cause problems for clients such as Google Calendar. Ideally control characters would also be removed.

    Cheers!

  10. Mark says:

    Thanks, I’ll work on an update.

  11. Mark says:

    Good idea, I’ll add a cutoff to only include more recent events.

  12. Mark says:

    I may add this in the future.

  13. Mark says:

    Thanks, I’ll add this in.