README.md
August 22, 2020 ยท View on GitHub
codestats-box-python
๐ป Update a pinned gist to contain your Code::Stats stats
๐โจ For more pinned-gist projects like this one, check out: https://github.com/matchai/awesome-pinned-gists
๐ Prep Work
- Make sure you have a Code::Stats account! (Get one at https://codestats.net/ if you don't!)
- Create a new public GitHub Gist (https://gist.github.com/)
- Create a token with the
gistscope and copy it. (https://github.com/settings/tokens/new) - Copy the
API token
๐ฅ Project Setup
- Fork this repo
- Go to your fork's
Settings>Secrets>Add a new secretfor each environment secret (below)
๐คซ Environment Secrets
-
GH_TOKEN: The GitHub token generated above.
-
GIST_ID: The ID portion from your gist url:
https://gist.github.com/aksh1618/ce5221fc5f3739d2c81ce7db99f17519.(Alternatively this can be put directly in
.github/workflows/codestats.ymlas it is public anyway.) -
CODE_STATS_USERNAME: Your Code::Stats username. (This can also be put directly in the yml)
-
STATS_TYPE: (Optional) Type of stats, supported values:
-
level-xp: (Default) Shows total and language XPs with level, sorted by XP:๐ป My Code::Stats XP (Top Languages) Total XP :::::::::::::::::::::: lvl 26 (1,104,152 XP) Java :::::::::::::::::::::::::: lvl 19 ( 580,523 XP) -
recent-xp: Shows total and language XPs with level and recent xp, sorted by recent XP:๐ป My Code::Stats XP (Recent Languages) Total XP ::::::::::::: lvl 26 (1,104,152 XP) (+1,874) Python ::::::::::::::: lvl 7 ( 82,719 XP) (+1,789) -
xp: Shows total and language XPs, sorted by XP:๐ป My Code::Stats XP (Top Languages) Total XP :::::::::::::::::::::::::::::::: 1,104,152 XP Java :::::::::::::::::::::::::::::::::::: 580,523 XP
(This can also be put directly in
.github/workflows/codestats.yml) -
๐ค Hacking
# setup
pipenv install --dev
# testing
# only content
pipenv run python codestats_box.py test <codestats-user> <stats-type>
# content and gist update
pipenv run python codestats_box.py test <codestats-user> <stats-type> <gist-id> <github-token>
# example
# pipenv run python codestats_box.py test aksh recent-xp ce5221fc5f3739d2c81ce7db99f17519 cf9181618bf1618253d17161843f71a2bb161850