[svlug] PubNub REST API examples
Jesse Monroy
jesse650 at gmail.com
Mon May 11 21:35:08 PDT 2015
John,
attached are two (2) bash shell scripts. They are using my account at pubnub.com
Signup here:
http://www.pubnub.com/get-started/#get-started
http://www.pubnub.com/customers/
Pubnub is a realtime messaging system. After 20~ minutes the message
will disappear. It tracks messages based on a timestamp; that is
returned when you send a message or receive a message. All messages
are sent and received as JSON.
You can send a message on the command line with talk2pubnub.sh. The
message on the command line must be quoted.
You can receive a message on the command line with listen2pubnub.sh.
Inside the code, you will see "# Previous timemarks ->
14314036513407082,". Replace that time mark with the timemark you got
when you sent the message.
The timemark is advances the pointer that reads the latest messages.
Otherwise, you get all the messages in the last 20 minutes.
Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: listen2pubnub.sh
Type: application/x-sh
Size: 478 bytes
Desc: not available
Url : http://lists.svlug.org/archives/svlug/attachments/20150511/df0cb9ce/listen2pubnub.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: talk2pubnub.sh
Type: application/x-sh
Size: 503 bytes
Desc: not available
Url : http://lists.svlug.org/archives/svlug/attachments/20150511/df0cb9ce/talk2pubnub.sh
More information about the svlug
mailing list