Created
August 22, 2014 16:36
-
-
Save kris-luminar/b3bcefa8b897c73624cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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