mirror of
https://github.com/alexellis/seeds2.git
synced 2022-05-09 04:08:56 +03:00
60972346564a194856e2c81e7934723226b257f3
seeds2
A Python application for live tweeting photos of your seeds
Example tweet: https://twitter.com/alexellisuk_bot/status/875077917902024706
Installation
- Install depedencies
$ sudo apt-get install python-pip
$ sudo pip install -r requirements.txt
- Update your access keys
Now add your Twitter keys into a config.py file:
config = {"ckey": "", "csecret": "", "akey": "", "asecret": "", "working_directory": "./", "image_quality": 35 , "tweet": True}
For testing without Tweeting you can set
tweettoFalsein theconfig.pyfile.
- Get the Roboto font from:
https://material.io/guidelines/resources/roboto-noto-fonts.html
- For scheduling the code - use
cronand this entry:
*/10 08-20 * * * /home/pi/seeds2/seed-it.sh
That runs once every 10 minutes between 8am and 8pm.
Docker
If you want to save time you can run the code through Docker. A Dockerfile is included in the repo.
- Building
docker build -t alexellis2/seeds2 .
- Running:
$ docker rm -f seeds2
$ docker run --privileged --name seeds2 -v `pwd`/config.py:/root/seeds2/config.py -ti alexellis2/seeds2
If you want to extract the image you can do it like this:
$ cd /home/pi
$ docker cp seeds2:/root/seeds2/image.jpg image.jpg
Languages
Python
77.6%
Dockerfile
20.1%
Shell
2.3%
