npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

koishi-plugin-zulove-acm-daily-problems

v1.0.1

Published

自用的每日推送acm题目

Readme

koishi-plugin-zulove-acm-daily-problems

npm

适用于 Koishi 的每日 Codeforces 题目推送插件。

功能

  • 每日题目推送:为每个绑定用户生成 3 道题(简单/中等/困难),难度约为 rating、rating+300、rating+500(选题基准使用 max(800, rating),保证高分/0分账号也能拿到题目)。
  • 防重复:记录当天已分配题目,避免重复。
  • 提交检测:每 2 分钟检查 Codeforces 提交并统计当日 AC;只对当天分配的题目计分。
  • 计分规则:积分 = 题目难度/100,首杀额外加分;前五名按 5/4/3/2/1 加分。
  • 积分榜:每日样式(含头像 + 简/中/困完成块),渲染为 PNG(需 puppeteer)。
  • 题目详情:名称、分值、标签、直达链接、已解决数(如统计可得)。

前置依赖

  • koishi v4(含 database 服务)
  • 推荐启用 puppeteer 服务用于排行榜渲染(未启用时将退化为文本输出)

无需手动安装浏览器,Koishi 插件市场的 puppeteer 默认会管理。

安装与启用

  1. 在 Koishi 插件市场安装本插件 koishi-plugin-zulove-acm-daily-problems
  2. 确保已启用 database,可选启用 puppeteer
  3. 在插件配置中可设置:
    • 默认刷新时间:默认 00:00
    • 默认推送时间:默认 08:30
    • 提交检查间隔(分钟):默认 2

指令

  • 绑定cf 用户名:绑定当前账号与 CF 用户名;首次绑定会生成今日题(提示中的 rating 显示真实值,0 也显示 0)。
  • 解绑cf:二次确认后解绑并清空积分(首次会明确提示清空积分与记录)。
  • 每日题目:查看今日 3 道题(格式:分段“简单/中等/困难”,每段三行:题目名 + 链接(含分值))。
  • push 0/1:在群聊中开启/关闭本群每日推送;在私聊中切换个人推送开关(默认关闭)。
  • 设置刷新 HH:MM:在群聊中设置每日生成题目的时间。
  • 设置推送 HH:MM:在群聊中设置每日推送的时间。
  • 积分榜:查看积分榜图片(头像、首杀深绿、已 AC 绿色)。

使用指南

  1. 在目标群聊中发送:push 1 开启本群每日推送;可用 设置刷新设置推送 调整时间。默认不推送。

  2. 每位成员先执行:绑定cf <用户名>;提示里显示真实 rating(0 也显示 0),选题以 max(800, rating) 为基准生成 3 题。

  3. 随时发送:每日题目 查看题目详情(按“简单/中等/困难”分段,三行格式)。

  4. 完成题目后,插件会每 2 分钟自动检查你的当日提交,若命中当日题则自动计分;首杀将高亮并附加加分,前五名亦有加分。

  5. 查看积分与排行:

    • 积分榜:每日样式 PNG(控制台/沙盒环境自动兼容为内联图片)。

设计说明

  • 数据表:

    • cf_user:绑定关系与个人积分。
    • cf_problem:题目缓存(id、名称、难度、标签、链接、解决数)。
    • cf_daily:每日题目分配与完成情况(是否 AC、首杀、加分名次等)。
  • cf_score_history:每日积分变动与总分(用于积分榜展示)。

    • cf_group_settings:群级推送开关与时间。
  • 题目来源:Codeforces API problemset.problems,按 rating 就近选取,过滤当日重复。

  • 提交检测:Codeforces API user.status,仅统计当天时间后的 AC,且匹配到当日分配的题号才计分。

  • 渲染:如启用 puppeteer,排行榜以 HTML 渲染为 PNG;控制台/沙盒场景使用内联图片显示;未启用则降级为文本列表。

常见问题

  • 看不到 PNG 图片?
    • 请确认启用了 puppeteer 服务;或使用文本版输出。
  • 为什么没加分?
    • 仅统计当日分配的题目且提交时间在当日之后的 AC。
  • 能否重复绑定?
    • 默认绑定后不可再次绑定;解绑需 60 秒内二次确认。