Botchain is a financial Twitter bot, tweets out latest ticker price after a fixed interval of time. Build using Python and Tweepy
MIT License
This repo contains the source for the Twitter bot which Tweet out the latest Ticket price after a fixed interval of time.
All the bots are made with the help of tweepy
library for accessing the Twitter API, and CoinMarketCap
API for accessing the latest financial market data, and Railway
for the deployment.
Twitter Developer Account
CoinMarketCap API Keys (Optional if we don't need any financial market data)
CoinMarketCap API
free plan. we can get API access from here.Railway Account (Only necessary if we want to host the bot, not for running locally)
Fork this repository
Install all the dependencies from requirements.txt
file. We can also use the command to install all the dependencies at once.
pip3 install -r requirements.txt
.env
file in the root folder and add in our API keys and like so :Note: Here I have included 2 sets of keys because I am running 2 different bots from the same repo,
we can also use one of them, either BTC or Doge
BTC_CON_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_CONSUMER_KEY)
BTC_CON_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_CONSUMER_SECRET)
BTC_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_ACCESS_TOKEN)
BTC_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_ACCESS_TOKEN_SECRET)
BTC_COIN_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (CoinMarketCap API KEY)
DOGE_CON_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_CONSUMER_KEY)
DOGE_CON_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_CONSUMER_SECRET)
DOGE_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_ACCESS_TOKEN)
DOGE_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (TWITTER_ACCESS_TOKEN_SECRET)
DOGE_COIN_KEY = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (CoinMarketCap API KEY)
python3 doge.py
or python3 btc.py
, depending on which bot we are running.For hosting it remotely, we need to add some files like Procfile
and requirements.txt
, which are already present in the repo. We just need to add the API keys in the variable section on the Railway platform while deployment.
Note: Here I am running both the bot at the same time remotely, due to that we are using a
bash srcipt
in the Procfile, we can run single bot by havingweb: python doge.py
in the Procfile, for more details, please check Railway Offical Docs