Skip to content

Instantly share code, notes, and snippets.

@matsimitsu
Created November 12, 2009 12:12
Show Gist options
  • Save matsimitsu/232853 to your computer and use it in GitHub Desktop.
Save matsimitsu/232853 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'tinder'
campfire = Tinder::Campfire.new 'campfire_subdomain'
campfire.login 'username', 'password'
room = campfire.find_room_by_name 'room'
room.listen do |m|
if m[:message] == "whoisgettinglunch?" then
winner = room.users[rand(room.users.length)].strip.gsub(/<\/?[^>]*>/, "")
room.speak "#{winner} is getting lunch!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment