爱意满满的作品展示区。
fantastM

做了一个油猴脚本,可以给 GitHub 用户设置昵称

  •  
  •   fantastM · 1 day ago · 524 views

    在 GitHub 浏览 feed 时候,经常刷到一些有意思的内容,但却忘记这个用户是谁,是从哪关注的了。

    如果你跟我有一样的困惑,想给这些用户添加昵称或者备注,可以试用一下我写的油猴脚本,已经发布到 https://greasyfork.org/zh-CN/scripts/577748-github-nickname 上了,预览效果是这样的。

    github-nickname preview

    用户昵称支持显示在 https://github.comhttps://github.com/{username} 页面,需要通过 {"username": "nickname"} JSON 格式来配置用户名到昵称的映射数据,配置入口在插件菜单栏里,可以直接输入字符串,也可以输入一个返回这样数据的 HTTP URL 。我自己是把配置信息维护到 Gist 后,然后输入 Raw URL 的,使用起来还算方便。

    github-nickname usage

    github-nickname usage

    另外,如果你想把关注的 GitHub 用户名称导出来,批量处理一遍的话,可以使用官方的 REST API ,token 需要有 user:follow 权限。

    curl -L \
      -H "Accept: application/vnd.github+json" \
      -H "Authorization: Bearer <YOUR-TOKEN>" \
      -H "X-GitHub-Api-Version: 2026-03-10" \
      https://api.github.com/user/following?per_page=100 | jq -r '.[].login'
    

    相关的使用问题和改进建议,可以提交到 https://github.com/fantasticmao/user-scripts/issues 里,感谢你的反馈。

    最后感谢小米 MiMo 百万亿 Token 激励计划,我用着效果挺不错的。

    1 replies    2026-05-13 14:10:50 +08:00
    maxwel1
        1
    maxwel1  
       1 day ago
    赞,一直在期官方出个这样的功能
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1181 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 492ms · UTC 17:52 · PVG 01:52 · LAX 10:52 · JFK 13:52
    ♥ Do have faith in what you're doing.