Skip to content

Instantly share code, notes, and snippets.

@kris-luminar
Created August 22, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kris-luminar/b3bcefa8b897c73624cf to your computer and use it in GitHub Desktop.
Save kris-luminar/b3bcefa8b897c73624cf to your computer and use it in GitHub Desktop.
require 'restforce'
require 'faye'
require 'pry'
Restforce.log = true
client = Restforce.new username: '**********************************',
password: '************************',
security_token: '************************',
client_id: '*************************************************************************************',
client_secret: '******************'
name = "AllAccounts"
puts 'Topic: ' + name
begin
p client.authenticate!
puts "authenticated"
puts
EM.run do
client.subscribe(name) do |message|
puts message.inspect
end
end
rescue Exception => e
p e
puts "Could not authenticate. Not listening for streaming events."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment