inx ++
This commit is contained in:
parent
bc26c1257b
commit
e1b9999c0d
2 changed files with 15 additions and 2 deletions
|
@ -15,11 +15,12 @@ class Ans(StdAns):
|
||||||
if cmd == 'start':
|
if cmd == 'start':
|
||||||
self.DATASET({'status':'1'})
|
self.DATASET({'status':'1'})
|
||||||
self.sendmsg('inx 启动!')
|
self.sendmsg('inx 启动!')
|
||||||
while(self.DATAGET()['status'] == 1):
|
while(self.DATAGET()['status'] == '1'):
|
||||||
req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx")
|
req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx")
|
||||||
num = req.text[28:].split(",")[1]
|
num = req.text[28:].split(",")[1]
|
||||||
self.sendmsg('标普500现在情况: ' + num)
|
msgid = self.sendmsg('标普500现在情况: ' + num)
|
||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
self.delmsg(msgid)
|
||||||
|
|
||||||
return "现在 inx 真的停了!"
|
return "现在 inx 真的停了!"
|
||||||
|
|
||||||
|
|
12
zzcore.py
12
zzcore.py
|
@ -50,3 +50,15 @@ class StdAns():
|
||||||
'message': msg
|
'message': msg
|
||||||
}
|
}
|
||||||
return requests.post(url = url, data = json.dumps(data),headers = Headers).json()['data']['message_id']
|
return requests.post(url = url, data = json.dumps(data),headers = Headers).json()['data']['message_id']
|
||||||
|
|
||||||
|
|
||||||
|
def delmsg(self,msgid):
|
||||||
|
url = APIURL + "delete_msg"
|
||||||
|
Headers = {
|
||||||
|
'content-type': 'application/json',
|
||||||
|
'Authorization':'Bearer ' + AUTHORIZATION
|
||||||
|
}
|
||||||
|
data = {
|
||||||
|
'message_id' : msgid,
|
||||||
|
}
|
||||||
|
requests.post(url = url, data = json.dumps(data),headers = Headers)
|
Loading…
Reference in a new issue