One of the features I find it interesting in Google calendar is the possibility to create shared calendars, but also the availability of your calendar as XML or ICAL whatever it’s a private or public one. As soon as we have XML of our calendar available I was wondering why not integrating Google calendar directly in website. For example a community that use the service to manage their events, or to display your future trips in your blog

First of all I jumped the cross-domain AJAX story since I’m reading data from Google server, I simply written a small PHP script which will read the feeds and resend it again. Then I used my old AJAX RSS Reader, Google calendar don’t deliver RSS but it’s just XML, it’s not a big deal there is just few changes on the code the make it working.

So to get started I created a shared calendar that I called “AJAX Events”, I have added by the was conferences and seminars but it’s all happen on may 2006 and I don’t know how to make feeds return a longer period. Shared or not shared, since I’m using a PHP script to read from Google calendar you can even use the Private Address which will give you access to your events feeds directly from the reader. Then just copy the url to use it in the script below eventrss.php

1.// Change this with your Google calendar feed
2.$calendarURL = http://www.google.com/calendar/feeds/;
3.
4.// Nothing else to edit
5.$feed = file_get_contents($calendarURL);
6.header(Content-type: text/xml);
7.echo $feed;
In the javascript side the only changes are in the feed parser and how to handle the elements returned in the XML document. I have added also some more changes like displaying a “no events” message when the calendar is empty.
view sourceprint?
01.// Parsing Feeds
02.var node = RSSRequestObject.responseXML.documentElement;
03.
04.// Get the calendar title
05.var title = node.getElementsByTagName( itle).item(0).firstChild.data;
06.
07.content =
08.<div class="channeltitle">+title+</div>
09.
10.;
11.
12.// Browse events
13.var items = node.getElementsByTagName(entry);
14.if (items.length == 0) {
15. content +=
16.<ul>
17.<li>
18.<div class="error">No events</div>
19.</li>
20.</ul>
21.
22.;
23.} else {
24. content +=
25.<ul>;
26. for (var n=items.length-1; n >= 0; n--)
27. {
28. var itemTitle = items[n].getElementsByTagName( itle).item(0).firstChild.data;
29. var Summary = items[n].getElementsByTagName( isummary).item(0).firstChild.data;
30. var itemLink = items[n].getElementsByTagName(id).item(0).firstChild.data;
31. try
32. {
33. var itemPubDate = <font color="gray">[+items[n].getElementsByTagName(published).item(0).firstChild.data+] ;
34. }
35. catch (e)
36. {
37. var itemPubDate = ;
38. }
39.
40. content +=
41.<li>+itemPubDate+</li></font><a href="%27+itemLink+%27">+itemTitle+</a>
42.
43.;
44. }
45.
46. content += </ul>
47.
48.;
49.}
I have tested the script with Firefox 1.5.0.2 and IE7, it should work also without problems on other browsers. Well a small XML feature and you are open to the world, just use your imagination to personalize the css and find how you can use your calendar.
Original Source:http://blogswizards.com/javascript-solutions/integrate-google-calendar-in-your-website-using-ajax
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.
