Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2016 17:28
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
PubNub Time Series AI w/ Falkonry BLOCK
function process(request) {
const xhr = require('xhr');
const token = 'YOUR_FALKONRY_API_TOKEN';
const webhookUrl = '';
try {
request.message.time = new Date().getTime();
var params = {
method: 'POST',
headers: {
Authorization: 'Token ' + token,
Accept: 'application/json',
'Content-Type': 'application/json'
body: request.message
return xhr.fetch(webhookUrl, params).then(function (r) {
return request.ok();
} catch (e) {
console.error('Uncaught exception:', e);
return request.ok();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment