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

v2ex-pusher 新消息通知

  •  
  •   cnit · May 18, 2023 · 2032 views
    This topic created in 1096 days ago, the information mentioned may be changed or developed.

    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 replies    2023-05-19 12:49:32 +08:00
    bitkuang8
        1
    bitkuang8  
       May 19, 2023
    star+1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1878 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 16:14 · PVG 00:14 · LAX 09:14 · JFK 12:14
    ♥ Do have faith in what you're doing.