Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
plugins
twitter
Commits
f4fd716b
Commit
f4fd716b
authored
3 years ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
Set basic progress marks for plugin
parent
a84c0f07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
twitter/plugin.py
+5
-1
twitter/plugin.py
with
5 additions
and
1 deletion
+5
-1
twitter/plugin.py
+
5
-
1
View file @
f4fd716b
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets