Converting RSS feed to vCalendar (2 posts)

  1. Jem
    Posted 11 years ago #

    I've come across a script to convert an RSS feed to the vCalendar format (for use in apps like iCal), but it doesn't seem to be working for the RSS/RSS2 feed generated by WordPress 1.2.
    The script is located at http://www.codent.com/rss/rss2ical.php
    The problem is that the date entities (?) are set to a date, and not a particular time, so the posts turn up as all-day entries in iCal. I have tried some of the sample conversions at the above link, and they appear fine, so it's something in the WP RSS feed that is causing this to happen.
    I had a look at the Slashdot RSS feed (http://slashdot.org/slashdot.rss), and compared it to my feed (http://www.higgs-family.net/~jeremy/wp/wp-rss2.php), and noticed a difference in how the times are recorded.
    In Slashdot, the time/date is "2004-06-08T23:58:00+00:00", but in the WP feed, it's "Mon, 07 Jun 2004 02:01:47 +0000". I'm guessing this is the problem... but I don't know how to fix it.
    Can anyone offer any advice? Is it possible to change the format of the date in the feed?

  2. Jem
    Posted 11 years ago #

    Hmmm... I just looked at the source for wp-rss2.php, and saw this line for the published date:
    <?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?>
    If I changed it to this:
    <?php echo mysql2date('Y-M-dTH:i:s+0000', get_lastpostmodified('GMT'), 0); ?>
    It would probably work... At least, I hope!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.