This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var logger = require('log4js'); | |
logger.configure({ | |
appenders: [ | |
{type:'console'}, | |
{type: 'file', filename: 'logs/application.log', catergory:'application'} | |
], | |
replaceConsole: true | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DEBUG=* node server.js | |
var xmpp = require('simple-xmpp'), | |
http = require('http'), | |
fs = require('fs'), | |
path = require('path'), | |
logger = require('log4js'), | |
sparkMessage = require('./myutils/sparkMethods'), | |
os = require('os'); | |
//Console logging to file | |
logger.configure({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Monitor (opts) { | |
// default http request method | |
this.method = 'GET'; | |
// holds website to be monitored | |
this.website = ''; | |
//Track status | |
this.webStatus = 'down'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var config = require('./config.json'); | |
var message = require('./myUtils/sparkMessage'); | |
var botToken = "<Your bot token>"; | |
/* | |
Handles events emitted when a websites stop being monitored | |
@param - (String) website - website url | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var logger = require('log4js'); | |
logger.configure({ | |
appenders: [ | |
{type:'console'}, | |
{type: 'file', filename: 'logs/application.log', catergory:'application'} | |
], | |
replaceConsole: true | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Monitoring service route | |
app.get('/monitor', function(req, res){ | |
var json_response = {'name':'JabberAssist'}; | |
res.status(200).json(json_response); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
var Monitor = require('ping-monitor'); | |
var websites = require('./websites'); | |
var http = require('http'); | |
var port = process.env.PORT || 3008; | |
var events = require('./events'); | |
var logger = require('log4js'); | |
logger.configure({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Module parses all incoming requests from Spark webhooks and provides the responses for the bot from the node-flint framework. | |
*/ | |
var _ = require('lodash'); | |
var botString = "YourBotName "; | |
module.exports = function(flint){ | |
flint.hears(/(^| ).*( |.|$)/i, function(bot, trigger) { | |
var text = trigger.text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Constructor for creating a endpoint object with video xapi. | |
const util = require('util'); | |
const EventEmitter = require('events').EventEmitter; | |
const jsxapi = require('jsxapi'); | |
//pass in object | |
function TPXapi(endpoint){ | |
this.endpoint = endpoint; | |
this.xapi; | |
this.connectedStatus = 'false'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TpXapi = require( "./utils/endpoint"); | |
const codecs = ['10.10.10.116']; | |
const videoArray = []; | |
codecs.forEach( function (ip) { | |
const endpoint = { | |
'password':"password", | |
'username':"admin", | |
'ipAddress':ip | |
}; | |
const videoCodec = new TpXapi(endpoint); |