Blog

SEARCH

About There4

I build simple, clean, and maintainable internet applications. People should never need an owners manual to use software, I believe that applications can be easy to use while still being powerful. Applications should remain valuable through their entire lifespans, and should be flexible enough to grow and change as requirements shift.

I prefer to develop with Blueprint CSS, jQuery, and Cake PHP. I have extensive development history with PHP, MySQL, Microsoft SQL, and mixed Win32/Linux hosting environments.

Follow me on Twitter

Posting tweet...

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

Bitbucket script config

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

Bitbucket Post Setup
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!