This bot scrapes weather data from a website to format into a message, which is then broadcasted to a dedicated telegram channel. The script was written in Nodejs and is run on an AWS EC2 environment.
- Broadcasts CAT status messages
- Broadcasts PSI reading messages(toggleable with RUN_PSI, see environment vars)
These variables are used to give the bot and the scripts information that is private and necessary to instruct the bot on how to behave.
BOT_TOKEN
unique token for telegraf api to recognize which bot to useCHANNEL_ID
unique id for bot to access correct channelCAT1_USERNAME
username to access websiteCAT1_PASSWORD
password to access websiteWEB_LOGIN_URL
website urlWEB_CAT_URL
url for cat status page on websiteWEB_PSI_URL
url for psi readings page on websiteRUN_PSI
toggles psi reading messages(yes/no)
Begin by ssh-ing into the ec2 instance, which you will need access to the aws account for.
Make sure you are in bot directory [cd Telegram-Bot
], then
$ pm2 start index.js
$ sudo nano ~/.bashrc
Crtl-X, Y and Enter to save changes to environment variable file
See PM2 Docs for more info