public
Description: Tinder is an Ruby API for interfacing with Campfire, the 37Signals chat application.
Home | Edit | New

Home

Tinder is a library for interfacing with Campfire, the chat application from 37Signals. It is designed to be a full-featured API (since 37Signals doesn’t provide a real one), allowing you to manage and speak/listen in chat rooms.

Usage

require 'tinder'
campfire = Campfire.new 'mysubdomain'
campfire.login 'myemail@example.com', 'mypassword'
room = campfire.find_room_by_name "The Watering Hole"
room.speak 'Hello world!'
room.paste "my pasted\ncode"

Managing Rooms

room = campfire.create_room 'New Room', 'My new campfire room to test tinder'
room.rename 'New Room Name'
room.destroy

Guest Access

campfire = Campfire.new 'mysubdomain'
room = campfire.find_room_by_guest_hash 'abc123', 'John Doe'

Listening

messages = room.listen
#=> [{:person=>"Brandon", :message=>"I'm getting very sleepy", :user_id=>"148583", :id=>"16434003"}]

Or you can pass a block and it will check for new messages every couple seconds and call the block when there are new messages.

room.listen do |m|
  room.speak "You're dumb!" if m[:person] == 'Brandon'
end

Installation

Tinder can be installed as a gem or a Rails plugin:

gem install tinder
script/plugin install git://github.com/collectiveidea/tinder.git
Last edited by brandon, Wed Jan 28 20:47:52 -0800 2009
Home | Edit | New
Versions: