V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
cnit
V2EX  ›  分享创造

v2ex-pusher 新消息通知

  •  
  •   cnit · 343 天前 · 1039 次点击
    这是一个创建于 343 天前的主题,其中的信息可能已经有所发展或是发生改变。

    https://github.com/bestK/v2ex-pusher

    v2ex-pusher

    v2ex-pusher 是一个通过 V2EX api 使用 Github Action 每 5 分钟执行一次获取最新消息并发送通知的工具。

    Deploy with Vercel

    环境变量

    V2EX_TOKEN=...<your_v2ex_token>
    JSON_TO_FETCH_BASE64=...<your_push_request_base64> // 参考 telegram
    KV_URL="redis://...."<your_vercel_kv_url>
    KV_REST_API_URL="https://...vercel-storage.com" <your_vercel_kv_rest_api_url>
    KV_REST_API_TOKEN="AYg...." <your_vercel_kv_rest_api_token>
    KV_REST_API_READ_ONLY_TOKEN="..." <your_vercel_kv_rest_api_token>
    

    JSON_TO_FETCH_BASE64

    // Telegram
    {
        "method": "POST",
        "url": "https://api.telegram.org/bot<your_token>/sendMessage",
        "headers": {
            "Content-Type": "application/json"
        },
        "body": {
            "chat_id": <your_chat_id>,
            "text": "#replace_hoder#"
        }
    }
    

    Github secrets define

    secrets.VRECEL_APP_LINK
    

    APIs

    Request Description
    http://<your_vercel_link>/api/notify?v2exToken=<your_v2ex_token>&jsonToFetchBase64=<your_fetch_json_base64> Manually trigger a request with the specified V2EX token and base64 encoded JSON to fetch.
    http://<your_vercel_link>/api/id-history View the processed message IDs.
    http://<your_vercel_link>/api/id-history?clear=true Reset the list of processed message IDs.
    1 条回复    2023-05-19 12:49:32 +08:00
    bitkuang8
        1
    bitkuang8  
       342 天前
    star+1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5501 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 01:40 · PVG 09:40 · LAX 18:40 · JFK 21:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.