Twitter bot to send ascii art 8x8 procrystals to users who @ mention it.
- Run
initialise_db.py
which generatesprocrystaldb.db
SQLite database. - Manually set up an S3 bucket called
procrystals
and add the database. - Compile the procrystals code i.e.
cmake . ; make
- Initialise the empty directories
./output/
and./output/logs/
. - Add secrets to
./src/twitter/secrets.yml
.
Set up a crontab to run scripts/run.sh
every minute i.e.
* * * * * source /Path/To/.bash_profile; /Path/To/scripts/run.sh
Currently the set up is to check Twitter for the previous 2 minutes. This introduces overlap to ensure nothing is missed and duplicate Tweets should not be sent.
To catch up missed Tweets from the past week just run with:
python get_tweets.py 10000 1
Quick overview of the workings of various scripts
Run when starting up procrystalline session on new machine.
Pulls SQLite database from S3 bucket to ensure continuity of procrystal IDs.
Sets bio of bot to running.
Gets all tweets containing @ mention in specified time period.
Stores username and tweet ID to SQLite database.
Makes temporary file with seed information for procrystals code.
Checks database for tweets that need replying to and sends message.
Updates database if tweet was sent successfully.
Run when finishing session.
Push current database to S3 bucket.
Sets bio of bot to offline.