Make everything a GitHub svg poster and skyline!
svg
in README
emamplesgit clone https://github.com/yihong0618/GitHubPoster.git
pip3 install -U 'github_poster[all]'
pip3 install -r requirements.txt
The generated svg is in OUT_FOLDER
, named with type (for now)
Different types are used as specified below:
--year 2021
: You can specify a year (default) or a year range --year 2012-2021
--special-number1 10 -- special_number2 20
: By default, the number of different colors is automatically generated (special colors), you can also specify the color--special-color1 pink --special-color2 '#33C6A4'
: You can also specify the color--with-animation
: You can add animation (add GOGOGO animation)--animation-time 14
: you can control the animation time (default is 10s), use with --with-animation
--with-skyline
: You can save skyline stl
file (default skyline year is to_year),--skyline-with-name
: set to print user name on model, use with --with-skyline
--is-circular
: With this command, the svg will be circular and with animation--without-type-name
: Support for hiding the name of the build type in the title---stand-with-ukraine
Other parameters can be found with python3 -m github_poster <type> --help
GPX
GitHub postermv 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
GitHub posterSign in/Sign up Strava account
Open after successful Signin Strava Developers -> Create & Manage Your App
Create My API Application
: Enter the following information
Created successfully:
${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
code
value in the linkexample:
http://localhost/exchange_token?state=&code=1dab37edd9970971fb502c9efdd087f4f3471e6e&scope=read,activity:write,activity:read_all,profile:write,profile:read_all,read_all
code
value:
1dab37edd9970971fb502c9efdd087f4f3471e6
Client_id
、Client_secret
、Code
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
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
Nintendo Switch
GitHub posterFrom 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
GitHub posterFind your duolingo id
, F12 from XHR
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
GitHub posterLike 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
GitHub posterFind 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
GitHub posterFind 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'
The method above uses twint to scrape tweets directly from Twitter.
Alternatively, download your Twitter Archive and use contrib/convert_twitter_archive_to_json_data_source.py
to convert it to JSON data source and feed it to Json loader. This method is useful if one or more of the following applies to you:
YouTube
GitHub posterUse 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
GitHub posterFind your Bilibili (XHR) cookie
python3 -m github_poster bilibili --cookie "${bilibili-cookie}"
or
github_poster bilibili --cookie "${bilibili-cookie}"
GitHub
GitHub posterGet 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
GitLab posterGet 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
GitHub posterFind 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
posterFind 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
posterFind 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
Nike
poster获取 Nike 的 refresh_token
python3 -m github_poster nike --nike_refresh_token="your nike_refresh_token" --year 2012-2021
or
github_poster nike --nike_refresh_token="your nike_refresh_token" --year 2012-2021
Notion
posterGet Notion Internal Integration Token
(notion_token), see here for more details.
Internal Integration Token
below Secrets
after submitGet Notion Database ID(database_id), see here for more details.
Share
menu to Copy link
, and you'll get a URL looks like https://www.notion.so/{workspace_name}/{database_id}?v={view_id}
{database_id}
is the ID of your Notion DatabaseNote:The database need a property which type is Date
, the value of it will be used to generate the poster.
The name of the date property shoould be set as option prop_name
's value,default value is Datetime
python3 -m github_poster notion --notion_token="your notion_token" --database_id="your database_id" --prop_name="your prop_name"
or
github_poster notion --notion_token="your notion_token" --database_id="your database_id" --prop_name="your prop_name"
Garmin
poster需要填写 Garmin 的账号和密码
python3 -m github_poster garmin --garmin_user_name ${user_name} --garmin_password ${pass_word} --year 2016-2021 --special-color1 blue --special-color2 pink --me yihong0618 --cn
or
github_poster garmin --garmin_user_name ${user_name} --garmin_password ${pass_word} --year 2016-2021 --special-color1 blue --special-color2 pink --me yihong0618 --cn
Forest
GitHub posterNeed to add your Forest email and password
python3 -m github_poster forest --forest_email ${user_name} --forest_password ${pass_word} --year 2016-2021 --special-color1 blue --me yihong0618
or
github_poster forest --forest_email ${user_name} --forest_password ${pass_word} --year 2016-2021 --special-color1 blue --me yihong0618
Json(source data) types
postermake sure your json file format is like data.json
in examples
python3 -m github_poster json --json_file "your json data file" --year 2019-2021 --me PythonHunter
or
github_poster json --json_file "your json data file" --year 2019-2021 --me PythonHunter
Multiple types
postersupport multiple 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
or
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
Summary types
postersupport summary types
python3 -m github_poster summary --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 2021
or
github_poster summary --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 2021
Jike(source data) types
posterneed to find your Jike cookie from Jike (XHR)
and jike_user_id
, jike_user_id
can be find in your personal page link
eg. in the link https://web.okjike.com/u/82D23B32-CF36-4C59-AD6F-D05E3552CBF3
, 82D23B32-CF36-4C59-AD6F-D05E3552CBF3
is the user_id
ps. only get the data for the last year
python3 -m github_poster jike --jike_cookie "your jike cookie" --jike_user_id 'your jike user id' --year 2021 --me "your name" --with-animation --animation-time 14 --count_type 'like'
or
github_poster jike --jike_cookie "your jike cookie" --jike_user_id "your jike user id" --year 2021 --me "your name" --with-animation --animation-time 14 --count_type 'like'
Option argument count_type
, you can specify statistics type:
record
: post num (default)like
: post be liked numshare
: post be share numcomment
: post be comment numrepost
: post be repost numruter
(Chinese) 如何为 GithubPoster 添加 loader
Before submitting PR:
black
(black .
)isort
(isort --profile black **/**/*.py
)type
in yml
file
CI
refator and some Actions codeThanks is enough.
Sign in to post a comment
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Repository Comments ( 0 )