Can be use if a web server does not have API interface and you need to extract information from web page and store them. This program is designed to download a web page, extract useful data, and upload them to a ThingSpeak service using POST request.
Program is devided into four parts:
- Web page downloading - it downloads web page and returns it as JSDOM object
- Data parser - it parses data from JSDOM to JSON format
- Data uploading - it send POST request with data in body to ThingSpeak service
- Code in index file checks if environmental variables exist and run process of downloading and uploading data to ThingSpeak service every 15s
- Clone this repository: git clone https://github.com/koutnyt/Steam_measuring.git
- Navigate to the project directory
- Install the required dependencies: npm install
- Create .env file and insert variables
- STEAM_WEBSERVER = ...
- WRITE_API_KEY = ...
- DATABASE = ...
- Run typescript compiler: npx tsc
- Navigate to dist/src/
- Run script in
index.js
file: node index.js