General Question

benseven's avatar

Easy ICS Embedding / Parsing?

Asked by benseven (3189points) November 28th, 2008

My experience: hacking around with other people’s PHP / WP Plugins and CSS, HTML hand-coding, all-nighters and how to fight bears.

So, Myself and the keys player from my Ceilidh band are putting together an iPhone webapp to better deal with the leads, quotes and confirmed gigs for the band.

We currently have a version of this working OK, and my main responsibility is the ‘confirmed’ section. Currently I have this using Google Calendar’s output with the HTML embed configuration, which means an IFrame (yuck) and no control over tweaking the CSS and layout of the calendar output.

You can see this working here . It’s good in the mean time but here’s where I hit issues.

I’ve been looking for a tutorial on using the .ICS output from GCal and parsing it with PHP so that I can use the data in whatever layout and style I want to. Problem is none of my googling has been successful and I don’t know where to start. So my question is has anyone dealt with this kind of thing before and do you know of a simple parser with a human-readable guide to how it works?

A sub-question would be how easy is it to port a Wordpress plugin for use with a normal site, as this plugin looked useful but I’m not convinced I should use a whole WP install just to get to use a plugin!

Thanks in advance.

Observing members: 0 Composing members: 0

6 Answers

irondavy's avatar

I’ve never used it but this looks like it might be useful?

http://phpicalendar.net/documentation/index.php/Main_Page

benseven's avatar

Thanks – I’ll take a look. There seems to be a view in one of the examples that might be hackable into what I need.

If anyone else has any ideas, they’d still be appreciated!

derekpcollins's avatar

All Google Calendars have an associated XML feed. I would try using PHP’s simplexml_load_file function to parse the XML. This way you’ll have access to all the various attributes and you can style them as you’d like.

benseven's avatar

That looks great, thanks a lot!

derekpcollins's avatar

@benseven: Let me know if you need any further explanation.

There is pretty good introduction to using SimpleXML in PHP at Webmonkey.

wvpv's avatar

I was in a similar situation. The XML parsing things I found weren’t good enough. I ended up parsing the Google Calendar ICS file with the icalparser.php class from http://www.phpclasses.org/browse/package/4197.html. I’d be glad to share the modified source if you’re interested. It’s not pretty under the hood, but it works.

http://bluespringsnazarene.org and http://bluespringsnazarene.org/calendar.php

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther