CFGoogle - A ColdFusion Package For Interacting With Several Google APIs
Posted By : todd sharp Posted At : July 15, 2009 9:16 AM Posted In: Google, ColdFusion
8
I'm happy to announce that I've launched CFGoogle on RIAForge. This project is a set of ColdFusion Components built to interact with a number of Google APIs. The package contains a base CFC which provides basic authentication and session token retrieval. Other components in the package extend the base CFC to interact with individual Google services such as Docs and Analytics.
The base code and all inspiration for this project are taken (with permission from and many thanks) from the original work done by Raymond Camden to authenticate and work with the Google Docs API. The analytics component wraps some common dimensions into convenience methods for you. However, there are tons of different possible combinations of dimensions and metrics that you can pass to the Analytics API to get at your data. Have a look at the Analytics API if you feel need more data then I'm exposing with the convenience functions. The Google documentation is pretty decent, this page in particular should help you out with possible dimensions and metrics. If you want to roll your own query you can call the getAnalyticsData() method and pass it dimensions, metrics, filters, sorts, date ranges, etc. Most methods will return a struct - one key for the query, another for some metadata from the Google data feed. Play around with different combinations and see what you can get. Finally, here's a quick screencast if you're really bored and want to watch me demo the package:

If my projects ever die down, I will release a good one to RIA soon. This helps to motivate!
Hope to see your project too - I'm a huge proponent of Open Source - RIAForge rules!
I'll make sure to talk louder, or turn up the level on my mic next time.
Thanks my man,
Rob
What I got so far is:
<cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
<cfargument name="myFile" type="string" required="true" hint="file to upload.">
<cfset var result = "">
<cfset var service = variables.docservice>
<cfset theUrl = "https://docs.google.com/feeds/documents/private/fu... HTTP/1.1">
<cfhttp url="#theURL#" method="post" result="result">
<cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth(service)#">
<cfhttpparam type="header" name="Content-Length" value="81047">
<cfhttpparam type="header" name="Content-Type" value="application/msword">
<cfhttpparam type="header" name="Slug" value="#myFile#">
</cfhttp>
<cfreturn result.filecontent>
</cffunction>
But I get the following error when I output the result: 'Invalid request URI'
Anyone can help me out?
I did find a cfdump on line 32 of analytics.cfc, you may want to remove that.
Thanks again!