Visualize Github profile growth (followers, num repo, rank based on followers or num repo) with daily cron and Github Pages.
Available via Github Pages - https://freedomofkeima.github.io/github-profile-visualizer/.
Github provides a free, static page websites via Github Pages. In order to start using it, you need to:
- Fork this repo.
- Open your repo setting and scroll down to Github Pages. Change your
source
and save. Your setup should look like below.
- Clone your repo to your computer and run
sh init.sh GITHUB_USERNAME GITHUB_TOKEN
. Read the guide below on how to generate your token. - Install
jq
. You can either usesudo yum install jq
orsudo apt-get install jq
, depending on your distro. - Run
sh script.sh
(or./script.sh
) to update and upload your data. Add cron job integration (explained below) to automatically update your repository everyday. - Check if it works, visit
https://[GITHUB_USERNAME].github.io/github-profile-visualizer/
.
To access Github, we need to create a personal access token.
Access https://github.com/settings/tokens/new to generate a new personal token.
We need to set the following 3 scopes:
"scopes": [
"public_repo",
"repo:status",
"read:user"
]
public_repo
is used to allow us committing daily cron changes back to the repository, while repo:status
is used to get number of repositories, and read:user
is used to get number of followers & followings.
ok.sh
is adapted from whiteinge/ok.sh, which has BSD 3-Clause.
As of October 3, 2018, ok.sh
doesn't support list_followers
and list_following
. Therefore, ok.sh
in this repository is a freezed version with modifications.
We will store "Personal Access Token" that you have retrieved above in $HOME/.netrc
. See init.sh
for details implementation.
For other optional configurations, consult to whiteinge/ok.sh#configuration.
Assuming your repository clone is located at $HOME
, you can try running script.sh
manually via:
$ GITHUB_USER=[YOUR_USERNAME] GITHUB_TOKEN=[YOUR_TOKEN] $HOME/github-profile-visualizer/script.sh
At this point, you should be able to see a new commit in your repository, congrats!
The next step is, we want to automate the job. You can add the following line to your crontab (crontab -e
):
0 10 * * * GITHUB_USER=[YOUR_USERNAME] GITHUB_TOKEN=[YOUR_GENERATED_TOKEN] $HOME/github-profile-visualizer/script.sh &>/dev/null
Feel free to adjust the parameter above (schedule, source path, etc) based on your configuration.
This project is licensed under BSD 3-Clause.