之前用过很多种消息推送的工具,比如企业微信、IYUU 、钉钉、Server 酱、GNotify 、Ntfy 等,所以就用 Python 写了个消息推送的小工具在项目的其他地方能快速调用发送消息,其实就是网络请求调用了一下官方提供的 API 。
目前简单支持了企业微信、飞书、钉钉、Gotify 、Ntfy 、Server 酱、IYUU 、AnPush 、息知、传息、WPush 、PushPlus 、TG Bot 、Email ,还挺不完善的。
项目地址: https://github.com/TommyMerlin/ANotify
还是纯新手😶
pip install anotify
统一的调用格式:
from ANotify import Nwecom
# 企业 ID
CORPID = ''
# 应用 Secret
CORPSECRET = ''
# 应用 ID
AgentId = ''
wn = Nwecom.WxNotify(corpid=CORPID, corpsecret=CORPSECRET, agentid=AgentId)
wn.send_msg("test message")
wn.send_msg_markdown("**Hello**\n- test1\n- [ANotify]( https://github.com/TommyMerlin/ANotify)")
wn.send_text_card("test title", "test content", "https://www.example.com")
wn.send_file("./test.txt")
wn.send_img("./test.png")
from ANotify import Ngotify
TOKEN = ""
SERVER_URL = ""
gotify = Ngotify.GotifyNotify(SERVER_URL, TOKEN)
gotify.send_msg("title", "content")
gotify.send_msg("title", "**content**\n- No.1\n- No.2", Ngotify.MessageType.markdown)
from ANotify import Nntfy
TOPIC = ""
URL = ""
ntfy = Nntfy.NtfyNotify(TOPIC, URL)
ntfy.send_msg("title", "content")
from ANotify import Nanpush
TOKEN = ""
anpush = Nanpush.AnpushNotify(TOKEN)
anpush.send_msg("title", "content", "channel_id")
其余的就不一一写了
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.