HTML and CSS Reference
Once you've downloaded this zip file, unzip it into the directory along with your other files. Your
file structure will now look something like this:
squeeks-Pusher-PHP (dir) including lib (dir) with Pusher.php
An event can be triggering in just a few lines of code:
require ( 'squeeks-Pusher-PHP/lib/Pusher.php' );
require ( 'pusher_config.php' );
$pusher = new Pusher ( APP_KEY , APP_SECRET , APP_ID );
$pusher -& gt ; trigger ( 'comments-1' , 'new_comment' , array (
"comment_post_ID" =& gt ; 1 ,
"date" =& gt ; "Tue, 21 Feb 2012 18:33:03 +0000" ,
"comment" =& gt ; "The realtime Web rocks!" ,
"comment_author" =& gt ; "Phil Leggetter"
However, we need to apply a some additional logic before we trigger the event:
Check that the comment was added.
Extract the unique comment identifier from the $added array.