johnlauer / serial-port-json-server

A serial port JSON websocket server for Windows, Mac, Linux, Raspberry Pi, or BeagleBone Black that lets you communicate with your serial port from a web application. This enables web apps to be written that can communicate with your local serial device such as an Arduino, CNC controller, or any device that communicates over the serial port.
http://chilipeppr.com
GNU General Public License v2.0
355 stars 174 forks source link

const telegramAuthToken = '<5909370411:AAFdvgWEkWAeEG9asMVIZ3E7ek13vBIJgO0'; var requestmaker = require('request'); app.use(express.json()); app.post('/' + telegramAuthToken, function(request, response) { response.set('Content-Type', 'application/json'); console.log(request.body); const userText = request.body.message.text; const chatId = request.body.message.chat.id; sendTextToTelegram(chatId, userText); response.end(); function sendTextToTelegram(chatId, message) { message = encodeURI(message); const response = `https://api.telegram.org/bot${telegramAuthToken}/sendMessage?chat_id=${chatId}&parse_mode=Markdown&text=${message}`; console.log(response); requestmaker(response); } }); #81

Open ESTHERTERSEN opened 1 year ago