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

Posted August 21, 2012 at 10:44 AM by Ben Nadel

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

Aug 21, 2012 at 5:15 PM // reply »
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 : } />
*****************************


Aug 21, 2012 at 5:28 PM // reply »
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!


Aug 21, 2012 at 6:02 PM // reply »
11,314 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.


Aug 21, 2012 at 6:14 PM // reply »
4 Comments

@Ben,

That would be great if you could. and much appreciated!!

Thanks!

- Brian


Aug 22, 2012 at 8:58 AM // reply »
11,314 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 :)


Aug 22, 2012 at 8:59 AM // reply »
11,314 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.


Aug 22, 2012 at 11:19 AM // reply »
4 Comments

@Ben,

Thanks for the conversion, an all of your wonderful contributions to the ColdFusion Community!


Aug 22, 2012 at 11:43 AM // reply »
11,314 Comments

@Brian,

No problem! Hope you enjoy :)


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 18, 2013 at 9:20 PM
Mapping AngularJS Routes Onto URL Parameters And Client-Side Events
I couldn't find examples of passing multiple arguments using the when() routing statement so figured out through trial and error that you can pass multiple arguments using the following format: .whe ... read »
Jun 18, 2013 at 3:39 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
Hi Ben, THANKS! While not bleeding edge, it is new to me & I like learning new things every day! ... read »
Jun 18, 2013 at 12:30 PM
Disabling Auto-Correct And Auto-Capitalize Features On iPhone Inputs
Also spellcheck="false" should be mentioned as part of html5 specs ... read »
Jun 18, 2013 at 8:40 AM
Using Named Functions Within Self-Executing Function Blocks In Javascript
Hi Ben, you forgot to mention the most important thing for named self-executing functions - they can be referenced by name ONLY inside their execution context (which is parens in this case), it mean ... read »
dee
Jun 18, 2013 at 7:01 AM
My Safari Browser SQLite Database Hello World Example
hai ben, this program is really good i could understand the concept but i dint know how to save it and how to open it as you have done in the video can u give that details pls ... read »
Jun 18, 2013 at 6:04 AM
Clearing Inline CSS Properties With jQuery
Thanks a lot for for post! It helped me a lot... after being stuck since 24 hrs.. found solution from your post. Thanks again! ... read »
Jun 18, 2013 at 2:31 AM
SOTR 2013 - The Best Conference I Never Went To
I keep watching it, should keep me happily distracted until SotR14 ;) ... read »
Jun 17, 2013 at 9:45 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, As I was reading what you wrote, it occurred to me that maybe I do something similar to that in some of my client-side code. In an application I'm working on, there are a bunch of unrelated ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools