Commit f4fd716b authored by Alp Deniz Ogut's avatar Alp Deniz Ogut
Browse files

Set basic progress marks for plugin

parent a84c0f07
Showing with 5 additions and 1 deletion
+5 -1
......@@ -71,6 +71,7 @@ class TwitterPlugin(PluginBase):
return
try:
self.set_progress(0.0)
for f in tweepy.Cursor(self.api.get_friends, count=200).items():
if str(f.id) not in self.existing_account_ids:
self.process_user(f)
......@@ -79,7 +80,8 @@ class TwitterPlugin(PluginBase):
self.accounts[account.externalId] = account
logger.debug(f"Account exists {account.displayName}")
break
self.set_progress(25.0)
for f in tweepy.Cursor(self.api.get_followers, count=200).items():
if str(f.id) not in self.existing_account_ids:
self.process_user(f)
......@@ -89,10 +91,12 @@ class TwitterPlugin(PluginBase):
logger.debug(f"Account exists {account.displayName}")
break
self.set_progress(50.0)
for dm in tweepy.Cursor(self.api.get_direct_messages, count=50).items():
if dm.id not in self.existing_message_ids:
self.process_message(dm)
self.set_progress(75.0)
for t in tweepy.Cursor(self.api.home_timeline, count=200, exclude_replies=True, trim_user=True, tweet_mode="extended").items():
if t.id_str not in self.existing_tweet_ids:
self.process_tweet(t)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment