SEARCH
Commit integration from bitbucket.org to Campfire chat
Posted in: Blog, PHP by Craig Davis on November 25, 2009
My full time employer recently began to host our projects with Bitbucket.org. I’ve been very impressed so far, and have been enjoying the ease of browsing past revisions and merges. We also use the 37 Signals collection of applications. Bitbucket has some rudimentary Basecamp integration, but we spend time collaborating in Campfire, and I wanted to be alerted when commits were made via chat.
I found a php class called Icecube that integrates with the Campfire API. The documentation for the Bitbucket post data can be found in their help docs for the post payload. I combined this class with a code found at 61924.nl, The script from 61924 can receive the payload from Bitbucket, and process it correctly. I’ve modified the script to present the commit messages with improved formatting, and have added some config options.
Download the scripts
Download Icecube at 61924.nl
Download Bitbucket and Campfire script
Setup the scripts

Place both of the scripts into a web accessible directory, and open bitbucket.php and edit the config section of the file.

Next, open your bitbucket.org repo, choose admin, services, and then add a new post type. Then specify the url to bitbucketchat.php.
Using the script
Join the chat with another account, and make a post!
Questions or suggestions? Leave a comment!