Skip to content

zxcv32/UK-Power-Monitor-Twitter-Bot

Repository files navigation

UK-Power-Monitor-Twitter-Bot

Publish UK Power Monitor's stats on Twitter

Source data is generated from UK-Power-Monitor

Bot Twitter URL Creator Twitter URL

Build And Deploy

Local

  1. Create Twitter Project with OAuth 1.0a and apply for Elevated Access Level for Manage Tweet permissions here

  2. Clone this project

  3. Create .env and populate the variables

    cp .env.template .env

  4. Issue command go run main.go from root of the project

Docker [Dev]

  1. docker-compose up -d --build

Docker [Prod]

  1. 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
    
  2. Create .env file in the Docker host with all the required configurations
  3. Copy docker-compose.prod.yml to Docker host
  4. docker-compose -f docker-compose.prod.yml pull
  5. docker-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=""

About

Publish UK Power Monitor's stats on Twitter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •