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

写了个在 GitHub Actions 运行的 v2 抽奖小工具

  •  
  •   Pipecraft ·
    utags · Jan 3, 2023 · 1543 views
    This topic created in 1280 days ago, the information mentioned may be changed or developed.

    有个抽奖送话费活动正在进行中,今晚开奖。

    为了本次抽奖,写了一个在 GitHub Actions 运行的 v2 抽奖小工具。

    特点:

    • 调用 V2EX API ,获得回帖用户列表
    • 可以设置是否去重,要排除的用户名单(比如 OP )
    • 定时执行 GitHub Action ,抽奖结果打印在日志里,保证每次抽奖的公平性

    示例:

    const list = await getReplyUserList("905509"); // V2EX 主题 ID
    const luckyUsers = lottery(list, {
      size: 1, // 被抽中人数
      unique: true, // 是否去重
      excludes: ["Pipecraft"], // 要排除的名单,比如 OP
    });
    

    仓库链接: https://github.com/v2hot/v2lottery

    还没参与的朋友,快来参与抽奖吧。

    抽奖时间:

    • 2023 年 1 月 3 日 23 点 23 分,抽取 3 名
    • 2023 年 1 月 4 日 23 点 23 分,抽取 3 名
    Pipecraft
        1
    Pipecraft  
    OP
       Jan 3, 2023
    第一期抽奖程序成功执行完毕。github.com/v2hot/v2lottery/actions/runs/3830755805/jobs/6519033963



    明天,2023 年 1 月 4 日 23 点 23 分,将继续抽取 3 名,大家快快参与吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5374 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 08:16 · PVG 16:16 · LAX 01:16 · JFK 04:16
    ♥ Do have faith in what you're doing.