A simple Twitter Bot to stay informed about Synthetix stats.
Added timestamps (idea came from spiyer99).
Also decided to remove the market cap to be able to keep the total value stacked
in ETH and BTC (also from spiver99).
I did keep the total value staked (ETH+BTC) converted to USD with live rates.
As proof, here's a picture from my bot Tweeter account:
Here's a link to it if you want to go and have a look for yourself: @TwitterBot2
TODOs:
- Setup Twitter Dev account and app
- Setup web scraper in Python
- Run Twitter bot in Python along with the web scraper
- Deploy to Heroku
- Write a nice little guide
git clone
this repo- Make a Python
venv
- Run
pip install requirement.txt
in thevenv
you've just created - Create an app in your Twitter developer account (https://developer.twitter.com/en)
- Create an account on https://www.cryptocompare.com/ and get your API key
- Fill in the bot.py file with your Twitter app, Cryptocompare API keys
- Create App on Heroku
- Go to the Settings tab of your app and add these to your Buildpacks:
- heroku/python
- heroku/google-chrome
- heroku/chromedriver
- Install Heroku CLI
- Follow the instruction on the Deploy tab of your Heroku App
- Before you push the repo to Heroku, run these two commands to make the environment
variable available to the bot:
1.
heroku config:set CHROMEDRIVER_PATH=/app/.chromedriver/bin/chromedriver
2.heroku config:set GOOGLE_CHROME_BIN=/app/.apt/usr/bin/google-chrome
- If your app is still not running for some reason, go and make sure that your worker is enabled in the Resources tab of your App
- If it still does not start, run this command :
heroku ps:scale worker=1
- 🎉Enjoy🎉 😃