Twitter: raymondcamden

Address: Lafayette, LA, USA

GoogleCalendar.cfc Version 1

04-20-2006 13,988 views ColdFusion 114 Comments

I've updated my GoogleCalendar.cfc. It now correctly (I think) handles time zone offsets and recurrences. I also added a simple way to make it refresh its own cache.

I think next I'll make a few convenience functions, like getTodaysEvents, getThisMonthsEvents, getThisWeeksEvents. Suggestions are welcome. (And if you use it on your site, let me know!)

The download is attached to this entry. I'll add a project page later on.

Oh - and I actually included instructions this time, and, thanks to certain events in the past, a license file as well.

Download attached file


  • Commented on 04-20-2006 at 9:46 PM
    Excellent. Added it to the open-source list...let me know when you add a project page and I will update the listing.
  • Commented on 04-20-2006 at 10:18 PM
    Did you mean to post the calendar on this page? (Or was it sucked away by the MCP?)
  • Commented on 04-20-2006 at 10:48 PM
    where do i download it again :) ?

    jk, really.
  • Commented on 04-21-2006 at 5:40 AM
    John, it's on the Download link.
  • mikeD #
    Commented on 04-21-2006 at 8:52 AM
    Not sure if you know about this TB/SB/FF plugin;
    "SyncKolab was written to add kolab functionality to thunderbird. It reads a selected Imap folder and synchronizes it with the local address book and calendar."
  • Commented on 04-21-2006 at 10:47 AM
    Thanks for the great start. I saw the Google calendar a couple of days ago and it about blew my mind. I have a customer that is trying to implement a scheduling calendar. The have been asking about dragging the appointments to different days in the calendar. That would require updating the database with the new date. Do you see a way in the Google API that when an event is moved or dropped to fire an event to a remote server to accomplish this?

    Jeff Douglas
  • Commented on 04-21-2006 at 11:04 AM
    Not sure what you mean. You can't change what happens on Google's site obviously. If you mean doing somethign on your site, sure. My code doesnt support Add yet, but I'm hoping ot add that next week. Then it's a matter of writing the DHTML I guess.
  • Commented on 04-27-2006 at 5:15 PM
    Could be a silly question, but how would you display the comments with /n in the correct positions?
  • Commented on 04-27-2006 at 5:16 PM
    and by /n i men \n
  • Commented on 04-27-2006 at 5:21 PM
    Replace any \n with chr(10) and it should do it.
  • Commented on 04-27-2006 at 5:24 PM
    so like this?
    <cfset modifiedContent = Replace(r.content, '\n' , '#chr(10)#', 'all')>
  • Commented on 04-27-2006 at 5:26 PM
    <cfset modifiedContent = Replace(r.content, '#chr(10)#' , '<br />', 'all')>

    seemed to work. i just didnt know what chr i was to replace...i thought it was \n or \r
  • Commented on 04-27-2006 at 5:27 PM

    also can i edit my comments so i dont have to send a new one everytime i think of something new
  • Commented on 04-28-2006 at 3:42 PM
    What's the best way to sort by the Google calendar feed's date field?

    Using a ColdFusion QoQ to sort on a field named "date" will throw an error.

    Is there a way to rename an existing query fieldname?
  • Lachie #
    Commented on 06-08-2006 at 12:10 PM

    What a great tool. Thanks so much!

    Please excuse my ignorance, I have not used cfc's at all. I can get the dump to work well from my calendar. But I am having trouble outputting a query onto my page. What code would I use to out put this.


    <cfoutput query="r">#author#</cfoutput> or

    <cfoutput query="application.gCal.readEntries()">#author#</cfoutput>

    I am sorry this is probably way basic and if I could get a nudge in the right direction I would be greatful.


  • Commented on 06-08-2006 at 9:44 PM
    the first line is the one you want, assuming you named the result "r".
  • Dylan #
    Commented on 08-01-2006 at 1:01 PM
    I'd love to check out your GoogleCalendar.cfc but the download link is dead - is it available anywhere?

    UCSD School of Medicine
  • Commented on 08-01-2006 at 2:37 PM
    All fixed now. I blame Microsoft.

    For those who want to see a real example, click on the Speaking Engagement tab above.
  • Commented on 08-30-2006 at 1:38 PM
    Nice piece. Somehow I was hoping for an inverse version. I'd like to find a way to create a dynamic iCal (Google, Sunbird, Apple etc) formatted calendar from an events database using CFMX. There are a few PHP or Java projects out there but nothing for CFMX.
  • Commented on 08-30-2006 at 2:02 PM
    Search my blog. I've got iCal code too. ;) I haven't played with it in a long time though.
  • Commented on 08-30-2006 at 3:07 PM
    Cant find iCal searching you blogs. Can you point me in the right direction?

  • Commented on 08-30-2006 at 3:14 PM
    Took me a while to find it:

    To be clear - this is an OLD project of mine. It isn't even listed on my projects page yet.
  • Commented on 08-30-2006 at 4:18 PM
    We're getting closer. Says "The download is in the My Tools pod" which I also can't find. Thanks for following through so quickly!
  • Commented on 08-30-2006 at 4:21 PM
    FOund it.
  • Commented on 08-30-2006 at 4:22 PM
    excellent. thanks
  • Leo #
    Commented on 09-12-2006 at 7:12 AM
    hi ray,
    I saw your gCal application and downloaded it but when i try browsing it, i get this error message "An error occured while Parsing an XML document.
    Content is not allowed in prolog." it has something to do with parsing to XML in the file GoogleCalendar.cfc. Anyone experiencing the same thing?
  • Commented on 09-12-2006 at 8:27 AM
    Double check the XML that was pulled down to make sure it is valid.
  • Leo #
    Commented on 09-12-2006 at 9:35 AM
    Please what's the difference between an XML file and MXML file. I only have the MXML file. where can i download the valid XML file from.
  • Commented on 09-12-2006 at 9:42 AM
    Where did you get a MXML file? That is not in my zip. (AFAIK)

    The XML comes from Google itself. Basically my CFC grabs the XML feed and parses it.
  • Leo #
    Commented on 09-12-2006 at 10:28 AM
    So where can i get the real zip file from. Sorry for bugging you like this
  • Commented on 09-12-2006 at 10:30 AM
    It is here:
  • Jay #
    Commented on 09-26-2006 at 2:41 PM
    How do you use this component? When I navigate to testa.cfm I get an error that says:

    Attribute validation error for tag http.
    The tag does not have an attribute called result. The valid attribute(s) are url, port, method, username, password, name, columns, charset, path, file, delimiter, textqualifier, resolveurl, proxyserver, proxyport, proxyUser, proxyPassword, useragent, throwonerror, redirect, firstRowAsHeaders, timeout, multipart, getAsBinary.

    What am I missing?
  • Commented on 09-26-2006 at 3:01 PM
    Did you change the URL used? testa.cfm had a test calendar that I do not think is available anymore.
  • Jay #
    Commented on 09-26-2006 at 3:07 PM
    Yes, I changed it to my URL. I removed the results attribute from the <cfhttp> tag in the .cfc file and now get a little further. Now I get the following error:

    You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members.

    The error occurred in C:\Inetpub\wwwroot\NewSite\GoogleCalendar.cfc: line 184
    Called from C:\Inetpub\wwwroot\NewSite\GoogleCalendar.cfc: line 19
    Called from C:\Inetpub\wwwroot\NewSite\calendartest.cfm: line 3

    182 :       <cfhttp url="#variables.calendarURL#">
    183 :       <!--- translate to xml --->
    184 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>
    185 :    
    186 :    </cffunction>

    My test page reads like this:

    <cfapplication name="gCal">

    <cfset reload = false>
    <cfif not structKeyExists(application, "gCal") or reload>
       <cfset application.gCal = createObject("component", "GoogleCalendar").init(">

    <cfset r = application.gCal.readEntries()>
    <cfdump var="#r#">

    <cfset m = application.gCal.readMeta()>
    <cfdump var="#m#">

    Does this require a partcular version of Cold Fusion MX? We are using MX 6.1.

  • Commented on 09-26-2006 at 3:15 PM
    Wait a minute. Your cfhttp doesn't have a results line. It should. Did you modify it? Can you add results="results" back in? This makes it CF7 only though. Are you on CF6?
  • Jay #
    Commented on 09-26-2006 at 3:17 PM
    Yes, we are on MX 6.1. That is probably the problem. I will look into upgrading.

  • Commented on 09-26-2006 at 3:33 PM
    Jay, while I was looking I found a bug. Watch my blog.
  • Jay #
    Commented on 09-27-2006 at 8:34 AM
    I upgraded to MX 7.1 and now it appears to be working. I do have one last(I hope) question. The following is returned from the testa.cfm page:

    query - Top 0 of 0 Rows

    SUBTITLE Jay xxxxx
    TITLE Jay xxxxx

    I have events scheduled on the calendar but they are not being pulled in. How do I show the data returned from the readEntries query specified in the testa.cfm?

    Thanks for all the help.
  • Commented on 09-27-2006 at 8:54 AM
    The struct is the metadata of your calendar. As for the events being zero, I'd suggest testing by requesting the URL you used for the calendar in your browser, and ensure you get valid XML back. If it still won't work, email me directly your XML url.
  • Jay #
    Commented on 09-27-2006 at 9:30 AM
    Thanks. I finally returned my events. I appears that there is a delay between when I update my calendar in Google and when it shows up on my end.
  • Jay #
    Commented on 09-27-2006 at 9:49 AM
    Any idea as to why it would be so slow to show the updates on my end? I made changes 20 min. ago that still have not shown up on my end.
  • Commented on 09-27-2006 at 10:09 AM
    It caches the parsing for performance reasons. Recreate the CFC and it will re-fetch.
  • Commented on 09-27-2006 at 10:10 AM
    Oh - you can all call update() to force a refresh.
  • Jay #
    Commented on 09-27-2006 at 10:28 AM
    Cool...forcing the update worked.

    One last thing...I have time offset in the testa.cfm set to -5(EST) but the time is still showing 1-hour behind what my Google Calendar shows. Any ideas?
  • Commented on 09-27-2006 at 10:32 AM
    Um, try -4? :)
  • Jay #
    Commented on 09-27-2006 at 10:45 AM
    Yeah, I already tried that. No change.
  • Commented on 09-27-2006 at 10:50 AM
    Don't forget to update() too when you change.
  • Commented on 09-27-2006 at 10:51 AM
    Just an FYI, this is an old post. If you downloaded from the download link, you have old code. You want to download from

    A new version was released this morning.
  • Jay #
    Commented on 09-27-2006 at 10:57 AM
    I changed reload to true and it corrected the time problem. Thanks alot for all your help.
  • Commented on 09-27-2006 at 10:58 AM
    Ah yes - load just regets the xml, but the CFC itself was cached with the settings.

    Sorry about that. :)
  • Jay #
    Commented on 09-27-2006 at 3:57 PM
    This is probably a silly question, but how do I loop through the structure to return each set of events? I tried using <cfloop collection= but that did not seem to work. Thanks
  • Commented on 09-27-2006 at 4:03 PM
    It returns a query. So you can use cfloop query= or cfoutput query=. TO see all the columns, just cfdump it.
  • Russ #
    Commented on 01-11-2007 at 11:29 AM
    Sorry for cross posting, but this seems a more active post...
    Why is it that no matter what I put in the calender url var on the testa page, it returns the Holidays calendar? It is obviously a cache issue, but I don't know how to fix it
  • Commented on 01-11-2007 at 11:35 AM
    Russ, I did respond on the other thread. My code allows you to pass a URl variable to reinit the application scoped cfc. Just pass that variable in the query string, or just stop using the application cache and use a normal variables-scoped variable.
  • Russ #
    Commented on 01-11-2007 at 2:09 PM
    Yea I couldn't remember which post I commented on, and I have a new spam filter that I haven't got control of yet, so I didn't get any reply responce...sorry:[
    I did figure out the reinit variable and of course it works great!
    I will have to have a look at that wish list, I am sure I can work the costs into my next project..
  • Commented on 01-11-2007 at 7:15 PM
    Glad you got it working.
  • Jay #
    Commented on 02-05-2007 at 2:17 PM
    I'm back again with a new question. Just the other day I installed the latest Microsoft updates on the web server and now Cold Fusion is throwing the following error:

    Local variable results on line 179 must be grouped at the top of the function body.

    The error occurred in C:\Inetpub\wwwroot\Application.cfm: line 16

    14 :
    15 : <cfif not structKeyExists(application, "gCal") or structKeyExists(url, "reinit")>
    16 :    <cfset application.gCal = createObject("component", "GoogleCalendar").init(calendar,-4)>
    17 : </cfif>
    18 :

    Any ideas as to why this would start occuring after a simple Windows update?

  • Commented on 02-05-2007 at 2:47 PM
    I don't know. Are you running CF7?
  • Jay #
    Commented on 02-05-2007 at 3:18 PM
    Yes CF7.
  • Commented on 02-05-2007 at 3:21 PM
    Are you running the code from THIS blog entry, or If from here, please get the one from RIAFOrge.
  • Jay #
    Commented on 02-05-2007 at 4:41 PM
    Well I downloaded the new code. I am past the error now. But now it is not pulling in all my events on the calendar. If I do a readentries() and then dump them using cfdump I only get 25 entries and none for today. I am also doing an update prior to the readentries. Any ideas?
  • Commented on 02-05-2007 at 5:06 PM
    Don't forget my code caches. You can run update() on the CFC to force it to refresh.
  • Jay #
    Commented on 02-06-2007 at 8:43 AM
    I have done this on my cfm page:

    <cfset u = application.gCal.update()>

    Shouldn't this be refreshing the cache?
  • Commented on 02-06-2007 at 8:45 AM
    Hmm. Well, maybe send me your code directly. Email it to me.
  • joe #
    Commented on 04-09-2007 at 3:03 PM
    I can't get the GoogleCalendar.cfc to work. I tried setting the calendar variable in testa.cfm to 1) my public xml url and then 2) my private xml url. It threw an error at <cfthrow message="Unable to load #variables.calendaruRL# - Invalid XML returned.">. Any ideas?
  • joe #
    Commented on 04-09-2007 at 3:04 PM
    I'm running CF MX7 and v 1.4 of gCal
  • Commented on 04-09-2007 at 4:33 PM
    You want to use your private url, and modify it as the docs say. Please send me your url directly if you want and I can test locally.
  • joe #
    Commented on 04-10-2007 at 1:35 PM
    once you test, please remove my comment with my private feed and I'll reset the private url.

  • Commented on 04-11-2007 at 7:31 AM
    When I ran your calendar, it worked fine. It parsed the metadata of your calendar ok, but returned no events. I viewed your XML directly (w/o gcal) and I can confirm that there are no events for this calendar showing up. Are you sure you have stuff scheduled? Because according to the XML (again, totally outside of my code) there are no events.
  • Commented on 06-29-2007 at 12:28 PM
    I get the following when trying to run your unmodified code with my data supplied in the test file.

    The request has exceeded the allowable time limit Tag: cfhttp

    The error occurred in C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc: line 181
    Called from C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc: line 19
    Called from C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm: line 5

    179 :       
    180 :       <!--- download xml --->
    181 :       <cfhttp url="#variables.calendarURL#" result="results">
    182 :       <!--- translate to xml --->
    183 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>


    Check the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.

    Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)
    Remote Address
    Date/Time 29-Jun-07 12:22 PM

    Stack Trace (click to expand)
    at cfGoogleCalendar2ecfc117159695$funcLOAD.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:181) at cfGoogleCalendar2ecfc117159695$funcINIT.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:19) at cftesta2ecfm1528332162.runPage(C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm:5)

    coldfusion.runtime.RequestTimedOutException: The request has exceeded the allowable time limit Tag: cfhttp
       at coldfusion.runtime.CfJspPage._emptyTag(
       at cfGoogleCalendar2ecfc117159695$funcLOAD.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:181)
       at coldfusion.runtime.UDFMethod.invoke(
       at coldfusion.filter.SilentFilter.invoke(
       at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(
       at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(
       at coldfusion.filter.FunctionAccessFilter.invoke(
       at coldfusion.runtime.UDFMethod.runFilterChain(
       at coldfusion.runtime.UDFMethod.invoke(
       at coldfusion.runtime.CfJspPage._invokeUDF(
       at cfGoogleCalendar2ecfc117159695$funcINIT.runFunction(C:\CFusionMX7\wwwroot\ows\Calendar\GoogleCalendar.cfc:19)
       at coldfusion.runtime.UDFMethod.invoke(
       at coldfusion.filter.SilentFilter.invoke(
       at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(
       at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(
       at coldfusion.filter.FunctionAccessFilter.invoke(
       at coldfusion.runtime.UDFMethod.runFilterChain(
       at coldfusion.runtime.UDFMethod.invoke(
       at coldfusion.runtime.TemplateProxy.invoke(
       at coldfusion.runtime.TemplateProxy.invoke(
       at coldfusion.runtime.CfJspPage._invoke(
       at cftesta2ecfm1528332162.runPage(C:\CFusionMX7\wwwroot\ows\Calendar\testa.cfm:5)
       at coldfusion.runtime.CfJspPage.invoke(
       at coldfusion.tagext.lang.IncludeTag.doStartTag(
       at coldfusion.filter.CfincludeFilter.invoke(
       at coldfusion.filter.ApplicationFilter.invoke(
       at coldfusion.filter.RequestMonitorFilter.invoke(
       at coldfusion.filter.PathFilter.invoke(
       at coldfusion.filter.LicenseFilter.invoke(
       at coldfusion.filter.ExceptionFilter.invoke(
       at coldfusion.filter.ClientScopePersistenceFilter.invoke(
       at coldfusion.filter.BrowserFilter.invoke(
       at coldfusion.filter.GlobalsFilter.invoke(
       at coldfusion.filter.DatasourceFilter.invoke(
       at coldfusion.filter.RequestThrottleFilter.invoke(
       at coldfusion.CfmServlet.service(
       at coldfusion.bootstrap.BootstrapServlet.service(
       at jrun.servlet.ServletInvoker.invoke(
       at jrun.servlet.JRunInvokerChain.invokeNext(
       at jrun.servlet.JRunRequestDispatcher.invoke(
       at jrun.servlet.ServletEngineService.dispatch(
       at jrun.servlet.http.WebService.invokeRunnable(
       at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(
       at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(
       at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(
  • Commented on 06-29-2007 at 12:43 PM
    Is your server on a network that can hit Google? Did you have some network issues? As the error says, CFHTTP timed out, so it could be any of that. Does your CF server kill requests longer than N seconds? If so, considering adding a cfsettinng to up the timeout a bit.
  • Dale Hans #
    Commented on 07-24-2007 at 11:08 PM
    I downloaded your CFC, changed the URL to my calendar and tried to run the testa.cfm file. I get an error:

    An error occured while Parsing an XML document.
    Content is not allowed in prolog.

    The error occurred in C:\Inetpub\wwwroot\_Gcal\GoogleCalendar.cfc: line 183
    Called from C:\Inetpub\wwwroot\_Gcal\GoogleCalendar.cfc: line 19
    Called from C:\Inetpub\wwwroot\_Gcal\testa.cfm: line 5

    181 :       <cfhttp url="#variables.calendarURL#" result="results">
    182 :       <!--- translate to xml --->
    183 :       <cfset variables.calendarXML = xmlParse(results.fileContent)>
    184 :    
    185 :    </cffunction>
  • Commented on 07-25-2007 at 6:21 AM
    Add a test before line 183. cfdump results and add a cfabort. Look at the result and see what is in the XML.
  • Dale Hans #
    Commented on 07-25-2007 at 9:01 AM
    Oops, I had not made my calendar public and it was notifying me of that fact.

    But, that brings up the question, is there a way to identify myself to Google in the request so that the calendar can remain private and yet I can get my own results via your cfc?
  • Dale Hans #
    Commented on 07-25-2007 at 9:03 AM
    Sorry for the premature reply. I missed the obvious and changed public to private and it worked fine it appears.
  • Dale Hans #
    Commented on 07-25-2007 at 3:01 PM
    I see from the notes that you were considering doing a mofification to allow uploading of events to Google. Is that still in the works?
  • Commented on 07-25-2007 at 4:08 PM
    No, not yet. Unfortunately the Google API is a royal pain in the you know what.
  • Dale Hans #
    Commented on 07-29-2007 at 12:00 AM
    I have the upload of a single event working now. So far, it only writes to the primary calendar for the user. It does an authentication using the e-mail / password for the user.

    I am continuing to work to add Creation of reoccuring events and possibly, create to a secondary calendar. I will send you my complete version of the GoogleCalendar.cfc when I get reoccuring done for your critique.
  • Commented on 07-29-2007 at 9:02 AM
    Sounds good, Dale. Thanks.
  • Steve-O #
    Commented on 01-09-2008 at 4:48 PM
    I was looking at the cfc to see if it would work for our needs. However, upon changing the url to our calendar location and running the test page, we get the following error:

    Error Executing Database Query.

    Query Of Queries runtime error.
    The select column reference [starttime] is not a column in any of the tables of the FROM table list.

    The error occurred in C:\CFusionMX7\CustomTags\GoogleCalendar.cfc: line 580
    Called from C:\Apache2\htdocs\dev\gcal.cfm: line 14
    Called from C:\CFusionMX7\CustomTags\GoogleCalendar.cfc: line 580
    Called from C:\Apache2\htdocs\dev\gcal.cfm: line 14

    578 :          select   *
    579 :          from   q
    580 :          where   starttime > <cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">
    581 :          </cfquery>
    582 :       </cfif>

    Any ideas here? We're running CF 7

  • Commented on 01-09-2008 at 5:15 PM
    Did you download it here? Or the latest version here:
  • Mark #
    Commented on 01-28-2008 at 10:02 PM
    Does this work with cf8? I have been trying and all that it pulls is the holiday calendar! I have been testing with my gmail account and my gmail for domains calendar, which does not have a private address! Any ideas with that??
  • Commented on 01-29-2008 at 8:12 AM
    It does work with CF8. If you want to send me your code directly, I'll test, and keep your urls private.
  • Mark #
    Commented on 01-29-2008 at 8:18 AM
    Thanks Ray, it works fine! I forgot to reinit so it was cached.
  • Mike #
    Commented on 04-10-2008 at 1:05 PM
    I did not see any "System Requirements" in the documentation in the downloaded files from this page:

    I'm assuming that is my problem... When I run on CF MX I get the error:

    Local variable colNames on line 41 must be grouped at the top of the function body.

    Will this only run on certain versions of coldfusion???
  • Commented on 04-10-2008 at 1:16 PM
    Please download from here instead:

    It requires CF7.
  • Ann #
    Commented on 09-04-2008 at 3:43 PM
    I downloaded the latest version from and I am getting this error message:

    The method 'getCalendars' could not be found in component D:\casemed_web\newhome\GoogleCalendar.cfc.
    Check to ensure that the method is defined, and that it is spelled correctly.
  • Commented on 09-04-2008 at 8:47 PM
    Odd. I just redownloaded from RIAForge, and I clearly see:

    <cffunction name="getCalendars" access="public" returnType="query" output="false" hint="Returns all the calendars for the user.">

    Did you maybe typo the call? getCalenders?
  • Commented on 12-07-2008 at 6:16 PM
    I'm having trouble with a recurring event, i have one that runs weekly every thursday The query does return that its an event that is weekly but it doesnt put in a date or time, it appears that the parseRecurrenceDate() function doesnt return anything just an empty string. Is this something i've done wrong or not doing? or can fix
    the recurring string thats returned seems very difficult to parse, in the google api docs it says about using a getTimes() function but i can't figure out how i would use it.
  • Commented on 12-07-2008 at 6:26 PM
    Me again...
    I managed to get it to show a date in the date field by changing the following line
    In the parseRecurrenceDate function in GoogleCalendar.cfc

    I changed
    <cfset datestring = reFindNoCase("DTSTART;VALUE=DATE:([0-9]+)", arguments.recurrence,1,true)>

    <cfset datestring = reFindNoCase("DTSTART;TZID=Europe/London:([0-9]+)", arguments.recurrence,1,true)>

    BUT this obviously wont work if your timezone isnt europe/London

    If anyone has a cleaner nicer solution or i am doing something silly please let me know.
  • Commented on 12-07-2008 at 6:37 PM
    Matt, would you mind emailing me your login info and the name of the event in question? Obviously I won't abuse it, but it will help me test.
  • Commented on 12-07-2008 at 6:56 PM
    I just sent you a mail through your contact form.
    It really is difficult to get this working actually because this type of event i need the time as well and when it does the parseRecurrenceDate function there is no time information and this is a recurring event that happens between 7pm and 9pm which i'll need to display.

    The bit where you do this parsing it hurting my head i'm wondering if i can get the start time and end time in the output somehow for recurring events.
  • Commented on 01-06-2010 at 10:36 AM
    Re comment 92 - only getting 25 entries. I had the same problem as no matter what url parameters I gave, it defaulted to 25, Fixed by a change in the cfc
    <cfhttp url="#variables.calendarURL#" method="GET">      
          <!--- translate to xml --->
          <cfset variables.calendarXML = xmlParse(cfhttp.fileContent)>
  • Commented on 01-22-2010 at 10:41 AM
    Just wanted to say that the script doesn't appear to work in Railo, I think it's because of the 302 redirect here:

    <cfhttp url="#curl#" result="result">
    <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#variables.authcode#">

    I get an xml error because the cfhttp retrieves the 302 redirect html rather than the feed.

    I don't think this is anything to do with your api though. Would be greatful if you have any ideas on how I can workaround this
  • Commented on 01-22-2010 at 12:18 PM
    I'm a bit confused - you are saying that when Railo uses CFHTTP it gets a different result?
  • Commented on 01-25-2010 at 3:08 PM
    Thats right. I think it is a problem with Railo though.

    I had to create the feed on a cf8 server and read that instead so that railo didnt see the redirect that happens on the google calendar api.

    the google api does a redirect before the data is returned
  • Dan #
    Commented on 10-06-2011 at 3:20 PM
    Hi. I'm having a real struggle getting started. Any help is greatly appreciated. Starting with testa.cfm, I get the error:
    "Content is not allowed in prolog. The error occurred in C:\...\GoogleCalendar.cfc: line 427"

    I modified 'calendar' to my own 'private' string, and set my username and password in application.gCal = createObject

  • Commented on 10-06-2011 at 9:11 PM
    Are you using the version here or the one at RIAForge?
  • Dan #
    Commented on 10-10-2011 at 1:42 PM
    RIA Forge
  • Commented on 10-10-2011 at 2:45 PM
    I'll have to take a look later this week. Got another bug as well.
  • Commented on 10-11-2011 at 9:05 AM
    I'm not able to reproduce this. If you are comfortable with it, email me your username/password so I can reproduce locally.
  • Dan #
    Commented on 10-12-2011 at 11:13 AM
    ok. Thanks for your help.
    I've run into the same error on my dev machine and on our live server. I'll see if I can get another dev machine to throw it as well.
  • Commented on 10-12-2011 at 11:14 AM
    Any debugging you can do - just let me know.
  • Dan #
    Commented on 10-12-2011 at 1:25 PM
    Had a small breakthrough. Upgrading to the latest CF9 patch seems to have cured the problem. Will report with more later.
  • Murray Hopkins #
    Commented on 12-13-2011 at 5:08 PM
    Hi Ray,

    Am I correct in assuming that this cfc would need changing to work with OAuth2 (as per your post

    If so, is anyone doing that (before I reinvent the wheel!)

  • Commented on 12-13-2011 at 5:12 PM
    I had someone pay me to do some basic work on the new CFC. He was cool with me sharing it. It supports getCalendars and addEvent, but that's it. But the new API, once you get past oauth, is pretty easy.

    I'm going to release this - but not this week. Please remind me (and if you need it _right now_, email me).
  • Murray Hopkins #
    Commented on 12-13-2011 at 5:55 PM
    Thanks Ray. It would be great to get a copy of that and if you were releasing it in the next couple of weeks that would be fantastic. Once I have the basics in place I can add and extend as required (and share back).

    And thanks for your oauth post - it helped greatly to get my head around the 'dance'.

    Best wishes,
  • Commented on 01-02-2012 at 7:37 PM
    Wow, a whole year later. ;) Sorry. I've made a zip of the bits. This isn't really supported, but it works under OAUTH2 now and will - one day - become the new version.
  • Sam Pinizzotto #
    Commented on 01-12-2012 at 6:10 PM
    How do I sort the calendar dates/entries?
  • Commented on 01-12-2012 at 7:47 PM
    This version doesn't support it. You would need to use query of queries.
  • Sam Pinizzotto #
    Commented on 01-13-2012 at 11:26 AM
    OK..I'll try that. Is there a new version?

    How can I get more than 25 results back from google?

  • Commented on 01-13-2012 at 12:02 PM
    Sam, there are a few new updates. The latest released version is here:

    The one linked to above was the beginning of a new version using Google's very latest API. I do not support it, but it is there if you would like.

    The version at RIAForge supports maxevents. Google defaults to 25, but you can ask for up to 100 I believe.
  • Muhammad Iftkhar #
    Commented on 02-09-2013 at 1:33 PM
    Hi Ray,

    Thanks for your useful code and continuous help to ColdFusion community. Ray, Google has released V3 and all we are waiting for your update on Google Calender. Hope soon we will see this.


    Best wishes,
  • Commented on 02-11-2013 at 8:49 AM
    No plans for this anytime soon. Pretty swamped. :(

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty