Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created June 11, 2009 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defunkt/127716 to your computer and use it in GitHub Desktop.
Save defunkt/127716 to your computer and use it in GitHub Desktop.
# the very first post-receive webhook target for github
# 2008-01-29
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'], commit['url'] ])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment