mirror of
https://github.com/mikumifa/biliTickerBuy.git
synced 2026-07-14 22:04:48 -04:00
18 lines
596 B
Python
18 lines
596 B
Python
import json
|
|
import requests
|
|
|
|
from util.notifer.Notifier import NotifierBase
|
|
|
|
|
|
class PushPlusNotifier(NotifierBase):
|
|
def __init__(self, token, title, content, interval_seconds=10, duration_minutes=10):
|
|
super().__init__(title, content, interval_seconds, duration_minutes)
|
|
self.token = token
|
|
|
|
def send_message(self, title, message):
|
|
url = "http://www.pushplus.plus/send"
|
|
headers = {"Content-Type": "application/json"}
|
|
|
|
data = {"token": self.token, "content": message, "title": title}
|
|
requests.post(url, headers=headers, data=json.dumps(data))
|