Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Matt Borgato
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Matt Borgato ( @borteo )

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

By on
Tags:

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

4 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 : } />
*****************************

4 Comments

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!

15,643 Comments

@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.

15,643 Comments

@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 :)

15,643 Comments

@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.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel