> mostly stupid bash tricks_ 

c u t u p @ c u t u p . o r g

 xml 

[php ical] last modified: 03/25/2007 02:04 pm

You can publish iCal calendars to a web page, and I wanted to be able to check it online. But it's not published in a very human-friendly way. So I wrote this little php script. Your published iCal calendar auto-updates, and then this script parses it and displays future events with date, and time (if present). For today's events, it even replaces the date with "TODAY."

It used to have some more frills, but when I started calling this script and displaying it on my desktop with Geektool, I took them all away.

So here's the script:

php_ical

It will look something like this.

THINGS I WANT TO DO: Support multiple calendars at once. Every time I try to do this, the script breaks.

NOTES: I use curl to get the published calendar into the script, since I use this on a Dreamhost account, and they have disabled filegetcontents(). Many people don't have curl compiled into php, so if you get a curl error, try replacing the part of the script from:

$ch = curl_init();

to curl_close($ch);

with:

$file = file_get_contents("$calendar");

and it should work.




[All Posts] [top]

tags:

ical
php