v2ex-pusher 新消息通知

353 天前
 cnit

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

v2ex-pusher

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

环境变量

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.
1051 次点击
所在节点    分享创造
1 条回复
bitkuang8
352 天前
star+1

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/940943

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX