官网地址:https://www.pushplus.plus/
直接利用HTTP请求即可
import…
from ast import Str
from nturl2path import url2pathname
from re import template
from socket import herror
from tkinter.ttk import Style
import requests
一对多信息推送
def pushplus_send(title,content,topics):
token ='7b0deafb89cd48909391be**********'
title= title
content = content
topics = topics
template = "html"
server_url = f'http://www.pushplus.plus/send?token={token}&title={title}&content={content}&template={template}&topic={topics}'.format(token,title,content,template,topics)
print(server_url)
requests.post(server_url)
if __name__ == '__main__':
pushplus_send("title","content","topic")
指定信息(好友消息)推送
def server_send(title, content, to):
token = '7b0deafb89cd44**************'
title = title
content = content
to = to
template = "html"
server_url = f'http://www.pushplus.plus/send?token={token}&title={title}&content={content}&template={template}&to={to}'.format(
token, title, content, template, to)
print(server_url)
requests.post(server_url)
if __name__ == '__main__':
server_send("title", "content", "to")
一对一信息推送
def server_send(title, content, template):
token = '7b0deafb89cd4890***********'
title = title
content = content
template = template # txt/htm/json/markdown
server_url = f'http://www.pushplus.plus/send?token={token}&title={title}&content={content}&template={template}'.format(
token, title, content, template)
print(server_url)
requests.post(server_url)
if __name__ == '__main__':
server_send("title, "content", "txt")