netease-recent-actions icon indicating copy to clipboard operation
netease-recent-actions copied to clipboard

🎧 通过GitHub Action将你的网易云音乐的听歌记录生成一张svg卡片

Netease Recent Actions

🎧 通过GitHub Action将你的网易云音乐的听歌记录生成svg

⚙ 前置工作

获取网易云音乐用户 ID (https://music.163.com)

  • 您的个人主页页面(https://music.163.com/#/user/home?id=xxx),id 为紧跟的那串数字

user_id

🔨 使用

需使用Github Actions,参考这个仓库的这个文件的配置,触发更新会自动提交163.svg这个文件至您的目标仓库

示例:

163-示例

默认配置

163-default

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0' # 北京时间每周一上午6点自动更新

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest # 使用最新版本,最新版本查看https://github.com/marketplace/actions/netease-recent-actions
        with:
          id: '126764012' # 你的网易云音乐账号id

听歌排行类型

163-type

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          type: '0'

配置说明:0:为所有时间的听歌排行;1:默认为1,即近一周的听歌排行

是否显示听歌次数对比百分比

163-percent

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          show_percent: '1'

配置说明:自定义为1,即显示听歌次数对比百分比;默认为0,即不显示

主题模式

163-theme

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          theme: 'light'

配置说明:主题模式自定义为light:浅色模式,默认为dark:暗夜模式

歌曲数量

163-number

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          number: 3

配置说明:歌曲数量自定义为3条,默认为5

标题

163-title

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          title: '最近在听'

配置说明:标题自定义为最近在听,默认为Recently Played

图片尺寸

163-size

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          size: 60

配置说明:图片尺寸自定义为60,默认为800;尺寸越小,优点是 svg 尺寸较小、请求返回的时间变短,缺点是图片会失真变模糊

卡片单列宽度

163-width

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          width: 380

配置说明:卡片单列宽度自定义为380,默认为280

列数

163-column

name: Netease Recent Actions

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  schedule:
    - cron: '00 22 * * 0'

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: zonemeen/netease-recent-actions@latest
        with:
          id: '126764012'
          column: 2

配置说明:列数自定义为2,默认为1

📄 开源协议

本项目使用 MIT 协议