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
gem install tinder
You can get the source from:
git clone git://github.com/collectiveidea/tinder.git
Tinder can also be installed as a gem or a rails plugin.
script/plugin install git://github.com/collectiveidea/tinder.git
Thanks to Zach Dennis for the name. Feedback and patches are welcome!

image courtesy of Tutorials.com
7 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 :-)
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”.
Hey man. You’re linked up on the campfire homepage.
Cool beans!
It appears that tinder no longer works after the 37 signals authentication overhaul. Anyone experiencing the same issue?
I’m having the same problem. Attempting to get rooms or users for a campfire site returns empty arrays.
Yep, 37Signals broke a bunch of stuff. I probably won’t have time to get it fixed until this weekend.
Yup, I’m having troubles as well. I’m trying to get the camper.rb and running into issues with how it uses room.listen (I think?). ‘Would be great if there were some sample code that showed how listen() might be used in such a context. thx.
Speak your mind: