Track your Twitter progress right in your profile image!
The app (once deployed) automatically updates your Twitter profile image as your followers change to reflect your Twitter progress with a progress bar!
You can deploy the app on a Deta Micro. It uses a Deta Base to cache the progress and the untouched avatar.
Note: You can enable deta auth
for endpoints.
All secret keys are to be loaded as environment variables.
If using on a local machine, you can place the keys inside a .env
file in the project's directory.
Example:
DETA_PROJECT_KEY=DDDDD
TWITTER_KEY=AAAAAA
TWITTER_SECRET=BBBB
ACCESS_TOKEN=CCCCC
ACCESS_TOKEN_SECRET=CCCCC
The app uses plain gradient image files (jpeg/png). Either create your own or grab 'em from Internet.s Here's a site that lists all possible sites to get gradients from.
Alternately, you can also use solid colors. Edit your preference in config.py
.
Edit config.py
as necessary
The ring resets for each lapse of track_mark
.
Let's say you set it to 100. Then, after reaching 100 followers it will reset back to 0 and count progress towards next 100 i.e. 200 followers.
After deploying to a Deta Micro, you can use CRON
to run micro after every x
minutes.
E.g. If you want it to check for change after every 60 seconds, set it up with:
deta cron set "1 minute"
Reset complete cache along with the cached avatar with:
deta run full-reset
Or reset just the followers cache to force a update:
deta run reset-count
Create a virtual environment with:
python -m venv venv
Activate it:
source ./venv/bin/activate
And run:
pip install -r requirements.txt
To create and save image to a local directory (for debugging), run:
python local.py