This is a simple project that downloads images tweeted by an account, recognises entities in it and creates a short movie.
- Python 3
- FFMPEG command
- Google Vision API: Download ths authentication key
- Twitter access key
- Install all requirements:
pip install -r requirements.txt
- Set the absolute path to Google Vision JSON:
export GOOGLE_APPLICATION_CREDENTIALS=/Path/To/JSON/Project-sla123kn31231.json
- Create a conf file:
{
"twitter": {
"consumer_key": "<your consumer key>",
"consumer_secret": "<your consumer secret>"
}
}
If you have completed all the above steps, simply execute the main.py
file: python3 main.py
or ./main.py
For the first run, the app will ask you to login to your twitter account, it should automatically open a browser with the link. Once you authenticate you will have to paste the pincode back into the CLI.
Then the app will ask you to enter any screen_name associated with a valid twitter account and in the end it will print the name of the movie generated. If not movie could be generated, it will print None
.
If you would like to extend the code and improve it/use it in your own program, follow the guide below:-
from main import main
mp4_file = main(screen_name="HDWallpaperFree", limit=10)