Skip to content

Commit

Permalink
新增息知消息推送
Browse files Browse the repository at this point in the history
  • Loading branch information
TommyMerlin committed Jun 13, 2024
1 parent c27d69d commit c96009b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
24 changes: 24 additions & 0 deletions ANotify/Nxizhi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import requests

class XizhiNotify:
def __init__(self, token):
self.token = token

def send_msg(self, title, content):
url = f"https://xizhi.qqoq.net/{self.token}.send"

payload = {
"title": title,
"content": content
}
headers = {"content-type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

return response.json()


if __name__ == "__main__":
TOKEN = ""
xizhi = XizhiNotify(TOKEN)
print(xizhi.send_msg("title", "content"))
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ anpush = Nanpush.AnpushNotify(TOKEN)
anpush.send_msg("title", "content", "channel_id")
```

### 息知
[官网](https://xz.qqoq.net/)
```python
from ANotify import Nxizhi
TOKEN = ""
xizhi = Nxizhi.XizhiNotify(TOKEN)
xizhi.send_msg("title", "content")
```

### IYUU
[官网](https://iyuu.cn/)
```python
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='anotify',
version='0.1.4',
version='0.1.5',
packages=find_packages(),
install_requires=[
'requests>=2.15.1',
Expand Down

0 comments on commit c96009b

Please sign in to comment.