Let’s say you have a user signup page, and you want to be notified whenever a user signs up in the Campfire chat.
tinder is the best library to interface with the Campfire API. I know that because it was last released today. So, gem install tinder.
Then, open your user.rb file and add the following:
1 2 3 4 5
The first line makes sure the announcement happens only after save.
Then, we initiate the connection to Campfire using tinder and our subdomain, key, and room id. The speak function assumes your User model has a name attribute, which would be printed in the Campfire chat.