Is this your first visit? You may want to subscribe to the feed.

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!

Tinder
image courtesy of Tutorials.com

Code: api, campfire, ruby, tinder Dec 08, 2006 ● updated Jun 19, 2008 7 comments

7 comments

  1. 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 :-)

    Mark Haliday Mark Haliday December 09, 2006 at 12:11 AM
  2. 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”.

    Brandon Brandon December 09, 2006 at 09:26 AM
  3. Hey man. You’re linked up on the campfire homepage.

    Cool beans!

    AJP AJP February 22, 2007 at 11:08 AM
  4. It appears that tinder no longer works after the 37 signals authentication overhaul. Anyone experiencing the same issue?

    Tim Harper Tim Harper December 15, 2009 at 02:10 PM
  5. I’m having the same problem. Attempting to get rooms or users for a campfire site returns empty arrays.

    Todd Todd December 17, 2009 at 12:07 AM
  6. Yep, 37Signals broke a bunch of stuff. I probably won’t have time to get it fixed until this weekend.

    Brandon Brandon December 17, 2009 at 12:09 AM
  7. 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.

    Robert Robert January 25, 2010 at 08:21 AM

Speak your mind:

*

*


* I hate spam and will never sell or publish your email address.

(You may use textile in your comments.)

Subscribe

Browse by Tag