[boobot] add a check_twitter method
This commit is contained in:
parent
d00822bfc6
commit
3a7010f478
1 changed files with 9 additions and 0 deletions
|
|
@ -188,6 +188,7 @@ class MyThread(Thread):
|
|||
|
||||
self.weboob.repeat(300, self.check_board)
|
||||
self.weboob.repeat(600, self.check_dlfp)
|
||||
self.weboob.repeat(600, self.check_twitter)
|
||||
|
||||
self.weboob.loop()
|
||||
|
||||
|
|
@ -202,6 +203,14 @@ class MyThread(Thread):
|
|||
return word
|
||||
return None
|
||||
|
||||
def check_twitter(self):
|
||||
for backend, thread in self.weboob.do('iter_resources', objs=None,
|
||||
split_path=['search', 'weboob'], backends=['twitter']):
|
||||
_item = thread.id.split('#')
|
||||
self.bot.send_message('%s: https://twitter.com/%s/status/%s' % (_item[0],
|
||||
_item[0], _item[1]))
|
||||
backend.set_message_read(backend.fill_thread(thread, ['root']).root)
|
||||
|
||||
def check_dlfp(self):
|
||||
for backend, msg in self.weboob.do('iter_unread_messages', backends=['dlfp']):
|
||||
word = self.find_keywords(msg.content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue