View source: R/RP_SelfServiceAPI_EndPoints.R
RP_APISubscribeRT | R Documentation |
Subscribes to real-time analytics.
RP_APISubscribeRT(APIHandler, datasetUUID, funPath)
APIHandler |
An API handler, created using RP_CreateAPIHandler. |
datasetUUID |
A string with the dataset identifier to subscribe. |
funPath |
The path to an R function to process the stream. Bear in mind the data will be passed from a curl call using a pipe. Something like: curl -s -H \"api-key:XXX\" \"https://feed.ravenpack.com/1.0/json/<datasetUUID>\" | R -f funPath As a function example: "f <- file("stdin") open(f) while(length(line <- readLines(f,n=1)) > 0) { write(line, stderr()) print(line) # do any other process }" |
A stream of JSON objects separated by '\n'
Jose A. Guerrero-Colon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.