【新】Luogu-Info 获取洛谷用户信息并实时生成小徽章
  • 板块灌水区
  • 楼主RainbowBird
  • 当前回复42
  • 已保存回复42
  • 发布时间2020/7/22 23:18
  • 上次更新2023/11/6 22:33:02
查看原帖
【新】Luogu-Info 获取洛谷用户信息并实时生成小徽章
312639
RainbowBird楼主2020/7/22 23:18

萌新第一次用NodeJS写项目,求支持QAQ

https://github.com/rain15z3/luogu-info

数据每两小时更新一次QAQ

所以不会容易爆网站

这次加了新功能(通过、提交总数、粉丝、AC率)

如果大家不嫌弃可以用我的服务器(当然您也可以自己搭

QAQ

Luogu Info

用于获取洛谷用户信息并实时生成小徽章(Shields)

支持的用法

  • 洛谷咕值
  • 通过题目(可以设置目标)
  • 访客统计

TODO

  • 支持洛谷登录
  • 添加新功能,如:提交/通过数量,AC率...

目前仅支持使用Cookie的方式来获取个人数据

效果图

洛谷咕值

通过题目

使用方法

需安装NodeJS至10.0版本以上

git clone https://github.com/rain15z3/luogu-info.git
cd luogu-info/
node .

访问http://localhost:98/register?uid=xxx&cookie=xxx&save=true以注册账户

注意:cookie指的是client_id

以上的地址和端口号改成你自己的,在config.json中可以设置

我的服务器

注意:我的服务器不是很稳定,请谨慎使用

服务器地址:http://luogu.app.luoling8192.top:98/

访问http://luogu.app.luoling8192.top:98/register?uid=xxx&cookie=xxx&save=true以注册账户

同理,把下文中的localhost换成luogu.app.luoling8192.top就可以了

接口

使用的时候请注意大小写

http://localhost:98/gen?uid=xxx&query=rating                # 总咕值
http://localhost:98/gen?uid=xxx&query=basicRating           # 基础信用
http://localhost:98/gen?uid=xxx&query=practiceRating        # 练习情况
http://localhost:98/gen?uid=xxx&query=socialRating          # 社区贡献
http://localhost:98/gen?uid=xxx&query=contestRating         # 比赛情况
http://localhost:98/gen?uid=xxx&query=prizeRating           # 获得成就
http://localhost:98/gen?uid=xxx&query=visitor               # 总访客数
http://localhost:98/gen?uid=xxx&query=ac                    # AC率(百分比)
http://localhost:98/gen?uid=xxx&query=passedProblemCount    # 通过数量
http://localhost:98/gen?uid=xxx&query=submittedProblemCount # 提交数量
http://localhost:98/gen?uid=xxx&query=followerCount         # 粉丝数量
http://localhost:98/gen?uid=xxx&query=followingCount        # 关注数量
# to表示目标数量,达到目标后颜色会变成绿色
http://localhost:98/gen?uid=xxx&query=problem0              # 未评定
http://localhost:98/gen?uid=xxx&query=problem1&to=50        # 红题
http://localhost:98/gen?uid=xxx&query=problem2&to=50        # 橙题
http://localhost:98/gen?uid=xxx&query=problem3&to=50        # 黄题
http://localhost:98/gen?uid=xxx&query=problem4&to=20        # 绿题
http://localhost:98/gen?uid=xxx&query=problem5&to=20        # 蓝题
http://localhost:98/gen?uid=xxx&query=problem6&to=5         # 紫题
http://localhost:98/gen?uid=xxx&query=problem7&to=1         # 黑题

Cookie获取方法

uidclient_id都可以在网站的Cookie里面找到

以Chrome为例,进入Dev Tools(F12)后可以找到

Dev Tools

2020/7/22 23:18
加载中...