Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

AI driven e-mail notifier for tweets mentioning stock from Elon Musk 📈

License

NotificationsYou must be signed in to change notification settings

PiotrRut/elonmusk-twitter-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This little scripts uses thetweepy Python library, which is a wrapper around the Twitter API.It sets up a listener on the@elonmusk Twitter account, and automatically detects whenever Elon Musk posts a tweet mentioning the any of the specified keywords(or any words containing those as substrings).

It also uses AI object detection from images using aYOLO based model that I've custom-trained to detectobjects such as dogecoins, bitcoins, doge etc.. in the images.

When a new tweet that meets the conditions is read, this program will automatically e-mail me with the transcript of that tweet. For tweets containing an image that the AIclassifies as ones containing objects it's trained to detect, the image will be attached as well. This is a way for meto always be up to date with stocks that may soon rise in value 🤡

Prerequisites 🗂

In order to run this locally, make sure you're Python interpreter is between v3.6 and 3.8 -this is due to the fact that Tensorflow won't work with newer versions. If you're on a newerPython version, consider downgrading withpyenv.

To install all the necessary dependencies, simply run the following command inside project root 👇🏻

$ pip install -r requirements.txt

Note:I havenot included my trained AI model in the repository due to the large file size -you can get it by navigating to thereleases tab, downloadingdoge-ai.h5 and placing it in the rootof the project.

Usage and config 👨🏻‍💻

If you would like to use this yourself, and receive juicy e-mail notifications every timeElon tweets, you can too! All you have to do is to have aTwitter Developer account and update the following environmental variables with yourTwitter API access keys:

# ./src/apiconfig.pyconsumer_key=os.getenv('CONSUMER_KEY')consumer_secret=os.getenv('CONSUMER_SECRET')access_token=os.getenv('ACCESS_TOKEN')access_token_secret=os.getenv('ACCESS_SECRET')

You will also have to update the following with your own e-mail details:

# ./src/emailsender.pymail_from=os.getenv('EMAIL_FROM')mail_to=os.getenv('EMAIL_TO')mail_pw=os.getenv('EMAIL_PW')

You might also have to update the SMTP server and port if you're not using Gmail.

Deployment 🚀

Unless you want to keep this program running inside an open terminal instance forever, you should think aboutdeploying it somewhere. To do this, first find a platform that suits your needs, such as Heroku, Amazon AWS or MS Azure.

You need to remember to set the same config vars on the server as you've done locally, otherwisethe program won't work. You also need to make sure that you install all the necessary dependencies (tweepy) - for most platforms this is doneby specifying them inside therequirements.txt file, but some services might need more. You will also have to make sure that your platform does not use Python above v3.8!

Some platforms also charge differently and offer different types of containers, so make sure you find one that suits your needs and doesn't cost much.

Dealing with bundle size 📦

One thing to keep in mind is that because of the large size of the AI model, as well as the size of the tensorflow install, the overall bundle size gets quite big quite quickly. Some platforms(particularly Heroku) limit the bundle size you can deploy (for Heroku it's 500mb), and thus deployment can become troublesome.

Preview 📲

Reveal screenshots

NotificationImage attachment
imageimage


may the stonks be ever in your favour


[8]ページ先頭

©2009-2025 Movatter.jp