Skip to content

Instantly share code, notes, and snippets.

@kyleconroy
Last active December 15, 2015 14:59
Show Gist options
  • Save kyleconroy/5278517 to your computer and use it in GitHub Desktop.
Save kyleconroy/5278517 to your computer and use it in GitHub Desktop.
Use websockets to receive Github repo events
var connection = new WebSocket('ws://socktocat.org/hooks?repo=:owner/:repo');
// Log events from Github
connection.onmessage = function (e) {
var events = JSON.parse(e.data); // An array of Github events
console.log(events);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment