Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Feeding a Google Calendar into a page


Reply

7 Posts   1957 Views

Avatar
pixelstuff

25 April 2009 at 9:23am (Last edited: 25 April 2009 9:26am), Community Member, 8 Posts

I was wondering if it's possible to display a Google Calendar feed on a calendar grid in a SilverStripe site.

I am coming from the MODx CMS where they have a Google Events snippet that uses SimplePie to reformat the XML feed into the necessary HTML for a calendar table or just about any other markup you want.

An example of it is here http://test.ebenezerbaptist.com in the "Upcoming Events" sidebar container. I used jQuery to display the events one at a time. The snippet also has a preset calendar table that can be used for a full sized month view (which I haven't styled and therefore haven't embeded yet).

Does anyone know if something similar can already be done, if not does anyone want to work on something that will do this? Either a new module or perhaps modifying the current Event Calendar module to accept Google Calendar feeds.

Avatar
UncleCheese

26 April 2009 at 1:44pm (Last edited: 26 April 2009 1:46pm), 4085 Posts

Hi, pixelstuff,

The current development effort in the EventCalendar project is to add this feature, so you're in luck. It will also accept one-time imports of ICS files for those who are migrating calendars. So stay tuned!

The hard part has been finding a reliable ICS parser for PHP. Anything you could send my way would certainly help out a lot.

Avatar
pixelstuff

26 April 2009 at 3:57pm (Last edited: 26 April 2009 4:27pm), Community Member, 8 Posts

You said a reliable parser. What have you tried already?

For example could the iCal parser in PHP iCalendar not be integrated?

Avatar
UncleCheese

30 April 2009 at 2:25am 4085 Posts

PHP iCalendar does not use a standalone parser. When I took a look at it, it had a bunch of different contingencies and it just didn't look like anything modular that I could port over to the EventCalendar. I've also looked at ICSReader, but the problem is it splits the file into lines, so events with multi-line descriptions break, because it thinks everything after the first line of that description is a new property. I've tried rewriting the regex, but it's way beyond me.

Any help you could offer would be appreciated!

Avatar
pixelstuff

30 April 2009 at 3:23am (Last edited: 30 April 2009 3:26am), Community Member, 8 Posts

Would the information here help you?
http://developer.apple.com/internet/appleapplications/icalendarfiles.html

The page discusses php and pearl methods for parsing.

I also came across this discussion on the parser for phpiCalendar. It is discussing plans for v3.0 I think.
http://phpicalendar.net/forums/viewtopic.php?f=58&t=2041

Avatar
UncleCheese

30 April 2009 at 3:28am 4085 Posts

Great! Thank you! I must have an old version of PHP iCalendar.

I like this comment on the Parser class:

"please be careful with the explode with spezial characters. a ":" or ";" may also occure in the DESCRIPTION: part."

EXACTLY!!

Avatar
pixelstuff

30 April 2009 at 4:01am Community Member, 8 Posts

Something else that looked interesting.
http://www.kigkonsult.se/iCalcreator/