Http requests samples
This file contains hidden or 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 BOT_TOKEN = ''; | |
const BOT_GROUP = 0; | |
const URL_BASE = 'http://10.0.1.12:21093'; | |
const securos = require('securos'); | |
const http = require('http'); | |
const { Telegraf } = require('telegraf'); | |
const bot = new Telegraf(BOT_TOKEN); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>PLACA EN LISTA NEGRA</title> | |
<style> | |
:root { |
This file contains hidden or 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 BOT_TOKEN = ''; | |
const URL_BASE = 'http://localhost:21093'; | |
const REST_API_URL_BASE = 'http://localhost:8898'; | |
const request = require('request'); | |
// const fs = require('fs'); | |
const http = require('http'); | |
const https = require('https'); | |
const url = require('url'); |
This file contains hidden or 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 { format, compareAsc, addSeconds } = require('date-fns'); | |
const CronJob = require('cron').CronJob; | |
const ONE_MINUTE = 60; // seconds | |
const cameras = ['3', '6', '10']; | |
const initDate = new Date(); | |
const job = createJob(initDate); | |
function createJob(initDate) { |
This file contains hidden or 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
// process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0; | |
const { WebSocket } = require('ws'); | |
const ws = new WebSocket('wss://192.168.100.5:8092', { rejectUnauthorized: false }); | |
ws.on('open', function open() { | |
console.log('connected'); | |
ws.send(JSON.stringify({ | |
"method": "subscribe", | |
"user": "root", |
This file contains hidden or 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 securos = require('securos'); | |
var express = require('express'); | |
var request = require('request'); | |
var app = express(); | |
var fs = require('fs'); | |
var url ="http://127.0.0.1:8096/securos_cam="; | |
var camid ="3"; | |
const picturesFolder = 'C://Users//ISS//Desktop//MBTA_Dataset'; | |
securos.connect(async function(core){ |
This file contains hidden or 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 http = require("http"); | |
const server = http.createServer((req, res) => { | |
let data = ""; | |
req.on("data", (chunk) => { | |
data += chunk; | |
}); | |
req.on("end", () => { | |
console.log(data); | |
res.end(); |
This file contains hidden or 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 PORT = 3001; | |
const securos = require("securos"); | |
securos.connect(function (core) { | |
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var app = express(); | |
app.use(express.json()); |
This file contains hidden or 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 securos = require("securos"); | |
securos.connect(function (core) { | |
const recording = core.registerEventHandler( | |
`MACRO`, | |
`1.1`, | |
`RUN`, | |
function (e) { | |
//Printing on console | |
console.log(`DATA: ${e.date}`); | |
console.log(`Object type ${core.selfType}, Object ID [${core.selfId}]`); |
NewerOlder