Skip to content

Instantly share code, notes, and snippets.

function Monitor (opts) {
// default http request method
this.method = 'GET';
// holds website to be monitored
this.website = '';
//Track status
this.webStatus = 'down';
"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
*/
var request = require('request');
var logger = require('log4js');
logger.configure({
appenders: [
{type:'console'},
{type: 'file', filename: 'logs/application.log', catergory:'application'}
],
replaceConsole: true
});
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);
//Constructor for creating a endpoint object with video xapi. Ability to scrape multiple API's.
const xapi = require('xapi');
const ZOOM = 'vip2.zoomcrc.com';
function zoomMeeting() {
xapi.event.on('UserInterface Extensions Panel Clicked', (event) => {
console.log('event', event.PanelId);
if (event.PanelId == 'zoom_dial') {
//Intial press of zoom button
xapi.command('UserInterface Message TextInput Display', {
//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';
"use strict";
const jsxapi = require('jsxapi');
let camera1active = false;
module.exports = class TPXapi {
constructor(endpoint) {
//super();
const xapi = require('xapi');
const MAINCAMERAID = '1';
const PRESENTATIONCAMERAID = '2';
//var farendCameraToControl = 'MAIN';
var farendCameraToControl = 'PRESENTATION';
var currentCallId = null;
var farendpresentationactive = 0;
var lastDirection = null;
#accept input data and keys "Status" and "Call"
async def nested_get(input_dict, nested_key):
internal_dict_value = input_dict
for k in nested_key:
internal_dict_value = internal_dict_value.get(k, None)
if internal_dict_value is None:
return None
#test to ensure Status is part of the new list
@voipnorm
voipnorm / blync_public.py
Last active July 22, 2019 20:09
BlyncLight Project in Python
#!/usr/bin/env python3
#Simple project to monitor and control a BlyncLight. Some helpful links to make this work:
#https://joshspicer.com/python37-ssl-issue
#https://github.com/cisco-ce/pyxows
#https://pypi.org/project/blynclight/
#https://github.com/signal11/hidapi
#https://kb.mccdaq.com/KnowledgebaseArticle50608.aspx?Keywords=Linux&Keywords=Linux
from pyxows import xows