Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created February 18, 2010 23:19
Show Gist options
  • Save defunkt/308202 to your computer and use it in GitHub Desktop.
Save defunkt/308202 to your computer and use it in GitHub Desktop.
The first GitHub webhook consumer (Campfire Notifier)
require 'rubygems'
require 'sinatra'
require 'json'
require '/var/www/famspam/production/current/lib/campfire'
post '/' do
payload = JSON.parse(params[:payload])
messages = []
repository = payload['repository']
payload['commits'].each do |sha, commit|
Campfire.notify("[%s] %s - %s %s" % [ repository['name'], commit['author']['name'], commit['message'], com
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment