Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at the New York ColdFusion User Group (Jul. 2009) with: Sean Schroeder

Pusher.cfc - A ColdFusion Wrapper For Pusher.com v1.12 REST API

By Ben Nadel on
Tags: ColdFusion

Yesterday, I launched a project - Crypto.cfc - for generating Hashed Message Authentication Codes (Hmac) in ColdFusion. As a follow-up, I wanted to quickly launch an updated Pusher.cfc ColdFusion component, which makes use of Crypto.cfc's hmacSha256() method when communicating with the Pusher.com REST API. Additionally, this Pusher.cfc update also has methods for subscribing to both "private" and "presence" channels - a new feature of the v1.12 Pusher.com API.

Project: View Pusher.cfc on GitHub.

Right now, Crypto.cfc is a dependency of Pusher.cfc. In ColdFusion 10, however, we have the hmac() function, which make generating Hashed Message Authentication Codes (Hmac) very easy. I plan to create a ColdFusion10 branch which removes the Crypto.cfc dependency.




Reader Comments

New to pusher... installed the latest code and am getting an error on the examples/all_features/index.cfm page.

I updated application.cfc with my pusher id, key and secret.

Any ideas?

Thanks!

- Brian

*****************************
Invalid CFML construct found on line 186 at column 34.
ColdFusion was looking at the following text:

{

The CFML compiler was processing:

A cfset tag beginning on line 186, column 18.


The error occurred in C:\Apache2\htdocs\aa_auctioneer\pusher\examples\all_features\index.cfm: line 186

184 :
185 : <!--- Create a PRIVATE message. --->
186 : <cfset message = {
187 : "text" = "Ah, Push it! Push it real good!"
188 : } />
*****************************

I am on a coldfusion 8 server. I think I need to change the application.cfc file component stucture... correct? anything else I need to to to dumb it down for CF8?

Thanks!

@Brian,

Let me see if I can create a "coldfusion8" branch tonight after work. There's probably a good amount that needs to be changed. But, I don't think it will take too long.

@Brian,

I added a "coldfusion8" branch to the GitHub repository. I basically converted everything over to a tag-based syntax and fixed the incompatibility between struct-literal notations across ColdFusion versions.

NOTE: I didn't do any further testing than making sure the demo worked :)

@All,

I also created a "coldfusion10" branch for a ColdFusion 10 compatible version which removed the Crypto.cfc vendor dependency. Since ColdFusion 10 has native hmac() functions, it was easy to replace.