Last active
August 29, 2015 14:07
-
-
Save stephenlb/2e001f9d92f920efc41d 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
## gem install pubnub | |
require 'pubnub' | |
pubnub = Pubnub.new( | |
:subscribe_key => 'sub-c-44d3418c-4855-11e4-8a5b-02ee2ddab7fe', | |
:publish_key => 'pub-c-eae49ba3-b1ee-46c4-8674-27ce042e7ab3' | |
) | |
## Get Latest Dashboard and Modify Revenue | |
pubnub.history( :channel => '', :count => 1 ) do |response| | |
dashboard = response[0][0] | |
## Trigger Sales Bell!!! | |
dashboard.merge({ :revenue => 500 }) | |
pubnub.publish( :message => dashboard, :channel => 'standard' ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment