Publish UK Power Monitor's stats on Twitter
Source data is generated from UK-Power-Monitor
-
Create Twitter Project with
OAuth 1.0aand apply for Elevated Access Level for Manage Tweet permissions here -
Clone this project
-
Create .env and populate the variables
cp .env.template .env -
Issue command
go run main.gofrom root of the project
docker-compose up -d --build
- Build and push Docker Image to registry.
Example:
$ docker build . -t zxcv32/uk-power-monitor-twitter-bot:main $ docker push zxcv32/uk-power-monitor-twitter-bot:main - Create .env file in the Docker host with all the required configurations
- Copy
docker-compose.prod.ymlto Docker host docker-compose -f docker-compose.prod.yml pulldocker-compose -f docker-compose.prod.yml up -d
Note that the twitter bucket needs to have an initial value for the bot to compare
You can write the initial data using the line protocol
twitter,tweet=monitor id=-1,status="live",content="",error=""