fix rss
This commit is contained in:
parent
562c433235
commit
53f71d822a
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
from zzcore import StdAns
|
from zzcore import StdAns
|
||||||
|
|
||||||
import feedparser, json
|
import feedparser, json, time
|
||||||
|
|
||||||
allowCMD = ['sub','unsub','list','disable', 'enable']
|
allowCMD = ['sub','unsub','list','disable', 'enable']
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class Ans(StdAns):
|
||||||
elif cmd == 'enable':
|
elif cmd == 'enable':
|
||||||
nowdata['status'] = True
|
nowdata['status'] = True
|
||||||
self.DATASET({gid:json.dumps(nowdata)})
|
self.DATASET({gid:json.dumps(nowdata)})
|
||||||
self.sendmsg("订阅已启用,咱会每隔五分钟抓去订阅,有新内容就会推送哦")
|
self.sendmsg("订阅已启用,咱会每隔五分钟抓取订阅,有新内容就会推送哦")
|
||||||
while(nowdata['status']):
|
while(nowdata['status']):
|
||||||
nowdata = json.loads(self.DATAGET()[gid])
|
nowdata = json.loads(self.DATAGET()[gid])
|
||||||
for sub in nowdata['allSub'].values():
|
for sub in nowdata['allSub'].values():
|
||||||
|
@ -97,6 +97,7 @@ class Ans(StdAns):
|
||||||
self.push(sub['title'], newfeedtitle, newfeedlink)
|
self.push(sub['title'], newfeedtitle, newfeedlink)
|
||||||
nowdata['allSub'][sub['url']]['lastUpdated'] = d.entries[0].published
|
nowdata['allSub'][sub['url']]['lastUpdated'] = d.entries[0].published
|
||||||
self.DATASET({gid:json.dumps(nowdata)})
|
self.DATASET({gid:json.dumps(nowdata)})
|
||||||
|
time.sleep()
|
||||||
|
|
||||||
elif cmd == 'disable':
|
elif cmd == 'disable':
|
||||||
nowdata['status'] = False
|
nowdata['status'] = False
|
||||||
|
|
Loading…
Reference in a new issue