Display an RSS Feed in iCal

31 May 2007

This is a quick and dirty php script I wrote up to convert an RSS feed into ics format so I could display it in iCal. It uses MagpieRSS to parse the RSS, then creates an event for each item. There is plenty of room for improvement here, but it’s working - in the screenshot above I have iCal subscribed to my feed, Daring Fireball, and FlickrBlog.

To do:

  • Include the main description of the items in the event description. This is simple enough, but I need a function to format the descriptions so they are compatible with ics.
  • I’d like to add a couple of query string options, in particular an option to display events as ‘all day’ events, instead of at a time.
  • The hCalendar microformat looks pretty interesting, but that’s another job entirely.

To use, download the script and upload to your server (or use from your local server). In iCal, select Calendar > Subscribe…, and enter the path in the format http://path/to/rss-ics.php?url=http://path/to/feed/.

In it’s current form it’s not particularly useful, but I have a few ideas already, and if anyone comes up with anything interesting using this I’d love to hear about it.

Update: Should now handle feeds that store the date in the dc:date field as well as those using pubDate.

Update: This works great for facebook status feeds.

There are 10 comments so far. Comments are open and you can add one here.

Posted under Internet, Mac, php.

Jamie

10 June 2007 @ 7:33 am

Just read about this over at TUAW and it sounds really interesting. If it worked with the RSS feeds coming out of 37signals ‘Basecamp’ then it would be really useful. The global RSS feed logs to-do items that have been added/completed. I assume it would plan them to iCal giving an overview of what’s been achieved on any particular day. I just wish I knew anything enough about PHP to try it!

Tom Henderson

11 June 2007 @ 1:09 am

To use basecamp’s RSS feed you just need to enter the username and password into the url in the following format: url=http://username:password@path/to/feed/. Note that your password will be sent unencrypted.

Joe

3 October 2007 @ 5:46 am

Awesome script, thanks!

Nikolas Schrader

17 October 2007 @ 8:23 pm

Isn´t it bad, that you only can add Blogs where this script is on the server?… But this script is really great, thanks!

Tom Henderson

21 October 2007 @ 11:41 am

The script can be run from your own server, or even locally on your built in server. It reads the rss feed you specify so the site doesn’t need to run the script.

Joel de Bruijn

27 December 2007 @ 10:15 am

I will try this to import my lifestream to google calendar. My lifestream is wwww.blogisch.nl, but I want to have a copy in Google Calender…

Joel de Bruijn

27 December 2007 @ 11:03 am

Yes, it works like a charm!
Thanks for the code!

Here’s what I did:
- setup a sub-domain, to make the script public available.
- put MagpieRSS and your script online.
- Added a Calender in Google Calender, via URL. The URL points to your script, with the RSS feed as a parameter.
- Looked at GCal: yes! I makes a copy of my lifestream.

Keep up the good work.

Lifestream kopie in Google Calendar

28 December 2007 @ 7:35 am

[...] BlogTender kwam ik een stukje php-script tegen dat RSS feeds omzet naar iCal formaat. Als deze via een URL in [...]

Livestream van Joël de Bruijn » Blog Archive » Lifestream kopie in Google Calendar

2 January 2008 @ 6:31 am

[...] BlogTender kwam ik een stukje php-script tegen dat RSS feeds omzet naar iCal formaat. Als deze via een URL in [...]

Matt Cooney

28 January 2008 @ 9:44 am

This wasn’t working with my atom feed, so I inserted this at line 46:

if (!$rfc3339) $rfc3339 = $item['published'];

I’m sure there are more elegant ways to do it, but it worked for me and maybe it will help someone. (You need a reasonably recent version of MagpieRSS.)

Thanks for the cool script!

Leave a comment:




XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Recently

Upgrading to WordPress 2.6
17 July 2008

Blogtender was hacked yesterday, resulting in a handfull of posts getting a list of invisible links added to the bottom, I assume in the hope that Google will pick them up. After changing my passwords (probably unnecessarily) I decided to upgrade to WordPress 2.6. The upgrade process is easy …

Incredibly Strange Film Festival iCalendars
12 July 2008

“I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.”Douglas Adams, Last Chance to See

The Incredibly Strange Film Festival is back …

Last.fm Charts
6 July 2008

This is a fun little script I wrote up that reads your weekly top albums chart from Last.fm, gets the cover art for each album, then displays the top albums on your blog. Scroll to the bottom of the page to see how it looks. …

Sharing a Canon laser printer between OSX and XP
5 January 2008

In case anyone else runs into this problem in the future, here are the steps needed to share a Canon Imageclass 4140 laser printer between OSX and XP. I’ve only tested this under Leopard, but it should work for Tiger as well.

First, the problem. While …

Archives: 2008 2007 2005

Music

Photos