Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created January 16, 2012 12:14
Show Gist options
  • Save wjessop/1620597 to your computer and use it in GitHub Desktop.
Save wjessop/1620597 to your computer and use it in GitHub Desktop.
$:.unshift File.join(File.dirname(__FILE__), 'lib')
require 'em-campfire'
EM.run {
adaptor = EM::Campfire.new(:subdomain => "subdomain", :api_key => "foo")
connection.join ["Robot Army", "Monitoring", "Testing"]
connection.on_message do |msg|
# A hash
puts msg.inspect
end
# Give lib a chance to connect
EM::Timer.new(10) do
# Say something on a specific channel
connection.say "This goes only to one channel", "Robot Army"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment