Skip to content

Instantly share code, notes, and snippets.

@mattallan
Last active December 22, 2016 14:03
Show Gist options
  • Save mattallan/992228a1cd204107b903e47562df3e1e to your computer and use it in GitHub Desktop.
Save mattallan/992228a1cd204107b903e47562df3e1e to your computer and use it in GitHub Desktop.
Example Pusher Listener
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="https://js.pusher.com/3.2/pusher.min.js"></script>
<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('8ffa40e2d51c6786802e');
var channel = pusher.subscribe( 'batch.128' );
channel.bind( 'batch.updated', function(data) {
console.log( data.message );
});
</script>
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment