我最近升级了一下openwrt系统,发现自带了一些推送配置,里面有个pushdeer,好像很方便。

官网地址:https://www.pushdeer.com/product.html

我用的是ios系统,只需要下载个pushdeer的APP(或者不下载,用他的轻APP)

登录之后选择“注册设备”,会得到一个pushkey,然后访问

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
https://api2.pushdeer.com/message/push?pushkey=key&text=要发送的内容
https://api2.pushdeer.com/message/push?pushkey=key&text=要发送的内容
https://api2.pushdeer.com/message/push?pushkey=key&text=要发送的内容

就可以推送文字了。

发送图片的话,用这个链接:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
https://api2.pushdeer.com/message/push?pushkey=<key>&text=<图片URL>&type=image
https://api2.pushdeer.com/message/push?pushkey=<key>&text=<图片URL>&type=image
https://api2.pushdeer.com/message/push?pushkey=<key>&text=<图片URL>&type=image

发送Markdown用这个:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
https://api2.pushdeer.com/message/push?pushkey=<key>&text=标题&desp=<markdown>&type=markdown
https://api2.pushdeer.com/message/push?pushkey=<key>&text=标题&desp=<markdown>&type=markdown
https://api2.pushdeer.com/message/push?pushkey=<key>&text=标题&desp=<markdown>&type=markdown

或者也可以写个Python小程序

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import requests
from typing import Optional
pushkey = '你的pushkey'
def pushdeer(pushkey:str, text:str, mtype:Optional[str]='text'):
api = 'https://api2.pushdeer.com/message/push'
data = {
'pushkey': pushkey,
'text': text,
'type': mtype,
}
r = requests.post(api, data)
return r.json()
print(pushdeer(pushkey, text='测试信息'))
print(pushdeer(pushkey, text='https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png', mtype='image'))
import requests from typing import Optional pushkey = '你的pushkey' def pushdeer(pushkey:str, text:str, mtype:Optional[str]='text'): api = 'https://api2.pushdeer.com/message/push' data = { 'pushkey': pushkey, 'text': text, 'type': mtype, } r = requests.post(api, data) return r.json() print(pushdeer(pushkey, text='测试信息')) print(pushdeer(pushkey, text='https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png', mtype='image'))
import requests
from typing import Optional

pushkey = '你的pushkey'

def pushdeer(pushkey:str, text:str, mtype:Optional[str]='text'):
    api = 'https://api2.pushdeer.com/message/push'
    data = {
        'pushkey': pushkey,
        'text': text,
        'type': mtype,
    }
    r = requests.post(api, data)
    return r.json()

print(pushdeer(pushkey, text='测试信息'))
print(pushdeer(pushkey, text='https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png', mtype='image'))

推送还是很及时的