GitHubPoster

Make everything a GitHub svg poster and Skyline!

twitter

shanbay

120966953-80d07180-c799-11eb-8769-92554905ab3f

Download

git clone https://github.com/yihong0618/GitHubPoster.git

pip install

pip3 install -U github_poster

Install(Python3.6+)

pip3 install -r requirements.txt

Use

  • Different types are used as specified below
  • You can specify a year such as --year 2021, (default) or a year range 2012-2021
  • The generated svg is in OUT_FOLDER, named with type (for now)
  • By default, the number of different colors is automatically generated (special colors), you can also specify the color: --special-number1 10 -- special_number2 20
  • You can also specify the color: --special-color1 pink --special-color2 '#33C6A4'
  • Other parameters can be found with python3 -m github_poster <type> --help
  • you can add animation, --with-animation (add GOGOGO animation), you can control the animation time --animation-time 14 (default is 10s)
  • you can save skyline stl file --with-skyline (default skyline year is to_year), set --skyline-with-name to print user name on model

GPX

Make your GPX GitHub poster

mv gpx files to GPX_FOLDER then run the code

python3 -m github_poster gpx --gpx_dir ~/blog/GPX_OUT/ --year 2013-2021
or pip
github_poster github_poster gpx --gpx_dir ~/blog/GPX_OUT/ --year 2013-2021

Strava

Make your Strava GitHub poster
  1. Sign in/Sign up Strava account

  2. Open after successful Signin Strava Developers -> Create & Manage Your App

  3. Create My API Application: Enter the following information


My API Application
Created successfully:


  1. Use the link below to request all permissions: Replace ${your_id} in the link with My API Application Client ID
https://www.strava.com/oauth/authorize?client_id=${your_id}&response_type=code&redirect_uri=http://localhost/exchange_token&approval_prompt=force&scope=read_all,profile:read_all,activity:read_all,profile:write,activity:write

get_all_permissions

  1. Get the code value in the link

example:

http://localhost/exchange_token?state=&code=1dab37edd9970971fb502c9efdd087f4f3471e6e&scope=read,activity:write,activity:read_all,profile:write,profile:read_all,read_all

code value:

1dab37edd9970971fb502c9efdd087f4f3471e6

get_code

  1. Use Client_idClient_secretCode get refresch_token: Execute in Terminal/iTerm
curl -X POST https://www.strava.com/oauth/token \
-F client_id=${Your Client ID} \
-F client_secret=${Your Client Secret} \
-F code=${Your Code} \
-F grant_type=authorization_code

example:

curl -X POST https://www.strava.com/oauth/token \
-F client_id=12345 \
-F client_secret=b21******d0bfb377998ed1ac3b0 \
-F code=d09******b58abface48003 \
-F grant_type=authorization_code

get_refresch_token

python3 -m github_poster --strava_client_id  ${client_id} --strava_client_secret ${client_secret} --strava_refresh_token ${refresh_token} --year 2012-2021
or pip
github_poster --strava_client_id  ${client_id} --strava_client_secret ${client_secret} --strava_refresh_token ${refresh_token} --year 2012-2021

NS

Make your Nintendo Switch GitHub poster

From APP(Nintendo Switch Parent Controls) using mitmproxy to get the session_token and devide _id

python3 -m github_poster ns --ns_session_token ${session_token} --ns_device_id ${device_id} --year 2020-2021
or pip
github_poster ns --ns_session_token ${session_token} --ns_device_id ${device_id} --year 2020-2021

Duolingo

Make your Duolingo GitHub poster

Find your duolingo id, F12 from XHR
image

python3 -m github_poster duolingo --duolingo_user_name ${user_id} --year 2015-2021
or
github_poster duolingo --duolingo_user_name ${user_id} --year 2015-2021

Issue

Make your Issue GitHub poster

Like my issue issue

	python3 -m github_poster issue --issue_number ${issue_number} --repo_name ${repo_name} --token ${github_token}
or
github_poster issue --issue_number ${issue_number} --repo_name ${repo_name} --token ${github_token}

LeetCode

Make your LeetCode GitHub poster

Find your LeetCode Cookie

python3 -m github_poster leetcode --leetcode_cookie ${leetcode_cookie} --year 2019-2021
or
github_poster leetcode --leetcode_cookie ${leetcode_cookie} --year 2019-2021

Twitter

Make your Twitter GitHub poster

Find your Twitter user_id (in the url)

python3 -m github_poster twitter --twitter_user_name ${user_name} --year 2018-2021 --track-color '#1C9CEA'
or
github_poster twitter --twitter_user_name ${twitter_user_name} --year 2018-2021 --track-color '#1C9CEA'

Youtube

Make your YouTube GitHub poster

Use Google History Takeout to download YouTube history data,choose json format,mv watch-history.json to IN-FOLDER then run the code

python3 -m github_poster youtube --year 2015-2021
or
github_poster youtube --year 2015-2021

Bilibili

Make your Bilibili GitHub poster

Find your Bilibili (XHR) cookie

python3 -m github_poster bilibili --cookie "${bilibili-cookie}"
or
github_poster bilibili --cookie "${bilibili-cookie}"

GitHub

Make your GitHub GitHub poster

Get your GitHub Name (in the url)

python3 -m github_poster github --github_user_name "${github_user_name}" --with-skyline
or
github_poster github --github_user_name "${github_user_name}" --with-skyline

GitLab

Make your GitLab GitLab poster

Get your GitLab Name (in the url)

python3 -m github_poster gitlab --gitlab_user_name "${gitlab_user_name}"
or
github_poster gitlab --gialab_user_name "${gitlab_user_name}"

For self-managed GitLab, specify the base url of your instance. You should use _gitlab_session from Cookies if sign in required.
s

python3 -m github_poster gitlab --gitlab_user_name "${gitlab_user_name}" --base_url "https://your-gitlab.com" --session "${gitlab_session}"
or
github_poster gitlab --gitlab_user_name "${gitlab_user_name}" --base_url "https://your-gitlab.com" --session "${gitlab_session}"

Kindle

Make your Kindle GitHub poster

Find your Amazon Cookie

python3 -m github_poster kindle --kindle_cookie ${kindle_cookie} --cn --year 2018-2021
or
github_poster kindle --kindle_cookie ${kindle_cookie} --cn --year 2018-2021

WakaTime

Make your WakaTime poster

Find your own WakaTime API Key at: WakaTime API Key

python -m github_poster wakatime --wakatime_key="your_wakatime_api_key" --year 2019-2021
or
github_poster wakatime --wakatime_key="your_wakatime_api_key" --year 2019-2021

Dota2

Make your Dota2 poster

Find your dota2_id, eg:Dendi's ID 70388657
Check your dota2_id(steamid32): https://steamid.xyz/.
Check your game data: https://api.opendota.com/api/players/{dota2_id}/matches.
more info: https://docs.opendota.com/#section/Introduction"

python -m github_poster dota2 --dota2_id="your dota2 id" --year 2017-2018
or
github_poster dota2 --dota2_id="your dota2 id" --year 2017-2018

Mutiple

Make your Mutiple types poster

support mutiple types

python3 -m github_poster multiple  --types "github, twitter, strava" --twitter_user_name "twitter user name" --github_user_name "github user name" --strava_client_id  "your strava client id"  --strava_client_secret "your strava client secret"  --strava_refresh_token "your strava refresh token"  --year 2020-2021

Contribution

  • Any Issues PR welcome.
  • Any new loader welcome

Before submitting PR:

  • Format Python code with black (black .)
  • Format Python code with isort (isort --profile black **/**/*.py)

TODO

  • [x] twitter
  • [x] GitLab
  • [x] GitHub
  • [x] LeetCode
  • [x] GitHub from issues
  • [x] YouTube
  • [x] Bilibili
  • [x] GitHub Actions
  • [x] Change all default color
  • [x] Skyline
  • [x] Dota2
  • [ ] Loader doc
  • [x] pypi
  • [x] test
  • [x] English README

GitHub Actions

  1. fork or clone this repo
  2. Change the secrets
  3. Change the type in yml file

image
image

GitHub

https://github.com/yihong0618/GitHubPoster