Tinder: Campfire API
update: Tinder can listen
update: Tinder is now available as a gem from rubyforge. Check out http://rubyforge.org/projects/tinder for more information.
For a project that I’m currently working, the client wants to be able provide live chat to its users. So, instead of re-inventing the wheel, we decided to try to use Campfire. The only problem is that I need to be able to create and destroy chat rooms automatically, and Campfire doesn’t have an API.
Caboo.se has done some work on a Campfire bot called Marshmallow but the code repository is unavailable. And, it doesn’t seem to allow you to create and delete rooms.
So, introducing Tinder, an API for interfacing with Campfire:
require 'rubygems'
require 'tinder'
campfire = Tinder::Campfire.new 'mysubdomain'
campfire.login 'myemail@example.com', 'mypassword'
room = campfire.create_room 'New Room', 'My new campfire room to test tinder'
room.speak 'Hello world!'
room.paste File.read("path/to/your/file.txt")
room.destroy
Install
You can get the source from:
svn co http://source.collectiveidea.com/public/tinder/trunk
Tinder can also be installed as a gem or a rails plugin.
script/plugin install http://source.collectiveidea.com/public/tinder/trunk
gem install tinder
Thanks to Zach Dennis for the name. Feedback and patches are welcome!

image courtesy of Tutorials.com








3 comments
I’m very curious to see how far you can get with this. I’ve been waiting and waiting for 37s to do an API to Campfire but I think they are tied up with other things (like Sunrise and getting Rails 1.2 out the door).
Keep going I say :-)
December 09, 2006 at 12:11 AM
Contributions would be appreciated :) It pretty much does all that I needed it to do (login, create rooms, destroy rooms) for the project I wrote it for, but it would be cool to make it a full featured “API”.
December 09, 2006 at 09:26 AM
Hey man. You’re linked up on the campfire homepage.
Cool beans!
February 22, 2007 at 11:08 AM