Sha256: faf03eeb2de566f1b0f5d601b2f552e46790b1ded9e3f3edf940d8eaa492617f
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
## ----------------------------------- ## PubNub Ruby API History Example ## ----------------------------------- ## including required libraries require 'rubygems' require 'pubnub_ruby/pubnub' ## declaring publish_key, subscribe_key, secret_key, cipher_key and ssl flag publish_key = 'demo' subscribe_key = 'demo' secret_key = 'demo' cipher_key = 'demo' ssl_on = false ## Print usage if missing info. if !subscribe_key puts(' Get API Keys at http://www.pubnub.com/account ============== EXAMPLE USAGE: ============== ruby history-example.rb PUBLISH-KEY SUBSCRIBE-KEY SSL-ON ruby history-example.rb demo demo true ') end ## Create Pubnub Client API (INITIALIZATION) puts('Initializing new Pubnub state') pubnub = Pubnub.new(publish_key,subscribe_key,secret_key,cipher_key,ssl_on) ## Request Past Publishes (HISTORY) puts('Requesting History with history() Function') message = pubnub.history({ 'channel' => 'hello_world', 'limit' => 5 }) puts(message)
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
pubnub-0.1.5 | examples/history_example.rb |
pubnub-0.1.4 | examples/history_example.rb |
pubnub-0.1.2 | examples/history_example.rb |