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
const AWS = require("aws-sdk"); | |
const Connect = require("aws-sdk/clients/connect"); | |
AWS.config.setPromisesDependency(require("bluebird")); | |
// Account 1 - Core services... after learning things in customer connect account we write to DynamoDB in this account | |
AWS.config.update({ | |
accessKeyId: "xxxxxxxxxxxxxxxxxxxxxxxx", | |
secretAccessKey: "xxxxxxxxxxxxxxxxxxxxxxxx", | |
region: "us-east-1" | |
}); |
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
const AWS = require("aws-sdk"); | |
const Connect = require("aws-sdk/clients/connect"); | |
AWS.config.setPromisesDependency(require("bluebird")); | |
module.exports.handler = async (event, context, callback) => { | |
AWS.config.update({ | |
accessKeyId: "g354yh76y54hrhj", | |
secretAccessKey: "dqwfwergfergerthetrhrtgrfw", | |
region: "us-east-1" |
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
let name = "Peter"; | |
let msg = `Hello ${name}`; | |
console.log(msg); |
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
// Pass DNIS when calling this function like so: getByDnis(8057052422) | |
// Import request library | |
const request = require('request'); | |
// Instantiate function | |
function getByDnis(dnis) { | |
// Define the API url | |
let url = 'PutTheApiUrlHere' |
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
const request = require('request'), | |
prompt = require('prompt'), | |
async = require('async'); | |
let main = function() { | |
return async.waterfall([ | |
getInput, | |
queryApi | |
], function(err, result) { | |
console.log(result); |
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
const request = require('request'), | |
prompt = require('prompt'), | |
async = require('async'); | |
async.waterfall([ | |
getInput, | |
queryApi | |
], function(err, result) { | |
console.log(result); | |
}); |
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
const mysql = require( 'mysql' ), | |
moment = require( 'moment' ), | |
csvWriter = require( 'csv-write-stream' ), | |
fs = require( 'fs' ), | |
async = require( 'async' ); | |
const query = "SELECT streammetrics.CallQuality AS WorstQuality, streammetrics.CallGUID, streammetrics.PairID, streammetrics.StartTime, streammetrics.EndTime, streammetrics.Codec, streammetrics.SourceSiteName, streammetrics.DestSiteName, streammetrics.SourceSwitchName, streammetrics.DestSwitchName, streammetrics.SourceEndpointID, streammetrics.SourceEndpointName, streammetrics.DestEndpointID, streammetrics.DestEndpointName, streammetrics.SourceIPAddress, streammetrics.DestIPAddress FROM streammetrics WHERE streammetrics.EndTime > 0 && streammetrics.StartTime BETWEEN UNIX_TIMESTAMP(CURDATE() - INTERVAL 1 DAY) AND UNIX_TIMESTAMP(CURDATE())"; | |
let goodCalls = [], | |
badCalls = [], |
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
const soap = require('soap'), | |
request = require('request'); | |
const url = 'https://fakeapi.com/stats?wsdl'; | |
let request_with_defaults = request.defaults({'auth': {'user': 'fakeuser', 'pass': 'fakepass', 'sendImmediately': true}}); | |
let soap_client_options = {'request': request_with_defaults}; | |
soap.createClient(url, soap_client_options, function(err, client) { |
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
const request = require('request'); // To hit the API | |
const fs = require('fs'); | |
const csv = require('csv-write-stream'); // To output a .csv | |
const jsonfile = require('jsonfile'); // To parse a .json file | |
const async = require('async'); // To make sure the program excutes top down | |
newArray = []; | |
// Begin async execution | |
async.waterfall([ |
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
const mysql = require('mysql'); | |
const request = require('request'); | |
const async = require('async'); | |
const fs = require('fs'); | |
const log = require('simple-node-logger').createSimpleFileLogger('project.log'); | |
const count = 1; // How many offices to change? | |
const connection = mysql.createConnection({ | |
host: '10.20.28.26', |
NewerOlder