Periodically updates your GitHub profile avatar, based on a provided directory of images.
Uses Gravatar XML-RPC API to change your GitHub avatar, as there is no way to upload an image via the GitHub API (be patient, the syncing process between Gravatar -> GitHub usually takes some time).
The period between avatar updates is 2 hours. Already uploaded images are cached in local file .already_uploaded_images_cache
(this is done to prevent duplicated images upload).
Requires Python 2(.7)
to run.
- Make sure your GitHub account has a Gravatar profile associated and is using it.
- If you have not defined a password for your Gravatar account yet, define it here.
- Create
.already_uploaded_images_cache
on the root of the repository (sorry, spaghetti Python code does not automatically create this file) - Get some images you would like to use as your GitHub avatar.
- Run!
python zazaza.cobrinha <email> <password> <images_dir_path> <dont_sleep=no>
If you are in an Unix environment, use screen
or nohup
to launch script as a background process.
Example with screen
:
screen -dmS cobrinhahihisewiiii -- python zazaza.cobrinha <email> <password> <images_dir_path>
If would like to schedule a cron job instead of letting program to sleep, just pass yes
next to <images_dir_path>
Thank you catherine
from StackOverflow for providing boilerplate code to interact with Gravatar XML-RPC API (https://stackoverflow.com/a/26099199).