/v2/history/sub-key/<sub-key>/channel/<channel>?URL_PARAMETERS
start (time token): Beginning of a timeline slice (exclusive)
## MacVim Good Terminal Only Installation Guide | |
## http://www.pubnub.com/ | |
## http://twitter.com/pubnub | |
## USAGE - Copy+Paste this One-liner: | |
## | |
## bash <(curl https://raw.github.com/gist/1858026/macvim-install.sh) | |
## | |
## OR - Download this file and execute |
require 'eventmachine' | |
require 'em-http-request' | |
require 'yajl' | |
module PubSub | |
class Pubnub | |
#** | |
#* Pubnub | |
#* | |
#* Init the Pubnub Client API |
import pam | |
## PubNub Access Manager (PAM) | |
manager = pam.access( | |
pubkey="pam", | |
subkey="pam", | |
seckey="pam" | |
) | |
## Grant User Access |
(function(){ | |
// Calculating a PubNub Message Payload Size. | |
function calculate_payload_size( channel, message ) { | |
return encodeURIComponent( channel + JSON.stringify(message) ).length + 97; | |
} | |
})(); |
// Libraries | |
#include <math.h> | |
// Literals | |
#define THERMISTOR A0 | |
// Constants | |
// Thermistor computation | |
const float ANALOG_STEPS = 4095.0; | |
const float B_THERM = 3977.0; |
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
## URL Variables | |
## http://p.pubnub.com/stream/<SUBKEY>/<CHANNEL>/0/-1 | |
## =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
## Demo Stream | |
while true; do (printf 'GET http://p.pubnub.com/stream/sub-c-5f1b7c8e-fbee-11e3-aa40-02ee2ddab7fe/pubnub-sensor-network/0/-1 HTTP/1.1\r\nHost: pubnub\r\n\r\n'; sleep 5) | nc p.pubnub.com 80; done | |
## Local tunnel | |
curl "http://0.0.0.0:80/publish/demo-36/demo-36/0/ch6/0/1" |
#!/usr/bin/python | |
""" | |
Functions are provided for both the DB and NDB Datastore APIs. | |
References: | |
* https://cloud.google.com/appengine/docs/python/datastore/queries | |
* https://cloud.google.com/appengine/docs/python/ndb/queries | |
""" | |
def db_fetch_all(query, limit=100, cursor=None): |
export default (request) => { | |
const xhr = require('xhr') | |
const pub_key = 'demo' // YOUR 2nd PUBLISH KEY | |
const sub_key = 'demo' // YOUR 2nd SUBSCRIBE KEY | |
const chncopy = request.channels[0] | |
const msgcopy = JSON.stringify(request.message) | |
const url = "http://pubsub.pubnub.com/publish/" + [ | |
pub_key, sub_key, 0, chncopy, 0, msgcopy | |
].join('/') | |