farzinadil / Dogefather

Twitter Bot that sends SMS alerts when influencers like Elon Musk tweet about stocks or cryptos.
GNU General Public License v3.0
60 stars 9 forks source link
cryptocurrency doge dogecoin elon elon-musk elonmusk image-processing nasdaq nyse stock-market stocks twilio twilio-api twitter twitter-api twitter-bot

Dogefather

GitHub last commit GitHub closed issues GitHub issues GitHub Repo stars GitHub forks

About

This program streams tweets from Elon Musk (or other influencers) and checks if the tweets contain references to popular stocks or cryptocurrencies. If the tweet contains text, it will scan the text for potential names or tickers of commonly traded stocks and popular cryptocurrencies. If the tweet contains images, the program will use Google VisionAI to annotate the images to determine if images contain references to stocks or cryptos. It can detect objects in images, logos, and text in images. If the program finds images or text referencing stocks or cryptocurrencies, it will send an SMS to the configured phone number using the Twilio API.

Installation

Requiremmts

  1. Python 3.8
  2. Twitter developer account
  3. Twilio account (trial account is fine)
  4. Google Cloud Platform account (for image recognition)

Instructions

  1. Clone repository
  2. cd Dogefather
  3. pip3 install -r requirements.txt
  4. Create a .env file and add Twitter API consumer key, consumer secret key, and bearer token as shown in .env.example
  5. Add the Twilio account sid and Twilio auth token to the .env file as shown in the .env.example file
  6. Add Google Vision API key to the .env file as shown in the .env.example file
  7. Add your phone number with +1 (ex: '+1800XXXXXXX') and your Twilio phone number in the same format as shown in .env.example
  8. python3 TweetBot.py

Examples

Finding stock/crypto in an image

Finding stock in tweet

Finding crypto in tweet

Sending alerts

Notes

stocks.json contains 100 most popular stocks and cryptos.json contains 5 popular cryptos. moreStocks.json contains all stocks and moreCryptos.json contains all cryptos. See https://cloud.google.com/vision/docs/setup for a quickstart of the Vision API.

What's Next

  1. Streaming tweets from more accounts rather than just Elon Musk.