Coder Social home page Coder Social logo

githubposter's Introduction

GitHubPoster

Make everything a GitHub svg poster

直接引入 svgREADME 中的例子

支持

下载

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

安装(Python3.6+)

pip3 install -r requirements.txt

使用

  • 不同类型按下方指定的使用方式
  • 可以指定年份如 --year 2021, (default) 或年份区间 2012-2021
  • 生成的 svg 在 OUT_FOLDER 内, 用 type 命名(暂时)
  • 默认自动生成不同颜色需要的 number(特殊颜色), 也可以指定如: --special-number1 10 -- special_number2 20
  • 也可以指定颜色: --special-color1 pink --special-color2 '#33C6A4'
  • 其它参数可以见 cli.py
  • 可以增加动画 --with-animation (加入 GOGOGO 动画), 可以控制动画时间 --animation-time 14(默认是 10s)

GPX

Make your GPX GitHub poster

把其它软件生成的(like running_page) gpx files 拷贝到 GPX_FOLDER 之后运行,或指定文件夹如我的文件夹是 ~/blog/GPX_OUT/

python3 cli.py --type gpx --gpx-dir ~/blog/GPX_OUT/ --year 2013-2021

Strava

Make your strava GitHub poster
  1. 注册/登陆 Strava 账号

  2. 登陆成功后打开 Strava Developers -> Create & Manage Your App

  3. 创建 My API Application
    输入下列信息: My API Application 创建成功:

  4. 使用以下链接请求所有权限
    将 ${your_id} 替换为 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 5. 提取授权后返回链接中的 code 值
例如:

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

code 数值为:

1dab37edd9970971fb502c9efdd087f4f3471e6

get_code 6. 使用 Client_id、Client_secret、Code 请求 refresch_token
终端/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

示例:

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

  1. 同步数据至 Strava
    在项目根目录执行:
python3 cli.py --type strava --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

需要下载 家长控制那个 APP(Nintendo Switch Parent Controls) 进行抓包(可以使用 mitmproxy 等抓包软件)

python3 cli.py --type ns --ns_session_token ${session_token} --ns_device_id ${device_id} --year 2020-2021

开心词场

Make your 开心词场 GitHub poster

需要下载开心词场的账号和密码

python3 cli.py --type cichang --cichang_user_name ${user_name} --cichang_password ${pass_word} --year 2016-2021 --special-color1 blue --special-color2 pink --me yihong0618

多邻国

Make your 多邻国(duolingo) GitHub poster

需要找到你的多邻国 id, 从网页抓 xhr 就可以获得如下图 image

python3 cli.py --type duolingo --duolingo_user_name ${user_id} --year 2015-2021

扇贝

Make your 扇贝(shanbay) GitHub poster

需要找到你的扇贝 user_id, 从网页抓 xhr 就可以获得如下图 image

python3 cli.py --type shanbay --shanbay_user_name ${user_name} --year 2012-2021 --special-color1 '#33C6A4' --special-color2 '#33C6A4'

Issue

Make your Issue GitHub poster

可以参考我的 issue

python3 cli.py --type issue --github_issue_number ${issue_number} --github_repo_name ${repo_name} --github_token ${github_token}

LeetCode

Make your LeetCode GitHub poster

需要找到你 LeetCode 的 cookie

python3 cli.py --type leetcode --leetcode_cookie ${leetcode_cookie} --year 2019-2021

如果使用的是 leetcode-cn(leetcode **需要加上参数)--is-cn

python3 cli.py --type leetcode --leetcode_cookie ${leetcode_cookie} --year 2019-2021 --is-cn

Twitter

Make your Twitter GitHub poster

需要找到你的 Twitter user_id, 网址里那个就是

python3 cli.py --type twitter --twitter_user_name ${twitter_user_name} --year 2018-2021 --track-color '#1C9CEA'

Youtube

Make your YouTube GitHub poster

利用 Google 的历史下载下载 YouTube 的历史数据,选择 json 格式,将 watch-history.json 拷贝到 IN-FOLDER 然后运行

python3 cli.py --type youtube --year 2015-2021

Bilibili

Make your Bilibili GitHub poster

需要找到你 Bilibili (XHR) 的 cookie

python3 cli.py --type bilibili --bilibili_cookie "${bilibili-cookie}"

参与项目

  • 任何 Issues PR 均欢迎。
  • 可以提交新的 loader

提交PR前:

  • 使用 black 对 Python 代码进行格式化。

TODO

  • twitter
  • gitlab
  • GitHub
  • LeetCode
  • GitHub from issues
  • YouTube
  • Bilibili
  • Steam
  • Spotify ?
  • 如何写 loader 的 doc
  • pypi
  • GitHub Actions
  • English README
  • Change all default color

GitHub Actions

  1. fork or clone this repo
  2. 更改需要的 secrets
  3. 更改需要的 type, 多个 type 用逗号分隔

image image

特别感谢

赞赏

谢谢就够了

githubposter's People

Contributors

yihong0618 avatar aibazhang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.