Commit f311a949 authored by Lee Lunn's avatar Lee Lunn Committed by GitHub

Adds option to pass follower / follower and user lists (#685)

parent 8cec66a2
......@@ -37,6 +37,8 @@ class Config:
Profile_full = False
Store_object = False
Store_object_tweets_list = None
Store_object_users_list = None
Store_object_follow_list = None
Pandas_type = None
Pandas = False
Index_tweets = "twinttweets"
......
......@@ -175,6 +175,17 @@ async def Users(u, config, conn):
if config.Store_object:
logme.debug(__name__+':User:Store_object')
if config.Followers or config.Following:
if hasattr(config.Store_object_follow_list, 'append'):
config.Store_object_follow_list.append(user)
else:
users_list.append(user) # twint.user.user
# also populate using the previous method to avoid breaking changes
if hasattr(config.Store_object_users_list, 'append'):
config.Store_object_users_list.append(user)
else:
users_list.append(user) # twint.user.user
if config.Pandas:
......@@ -198,7 +209,10 @@ async def Username(username, config, conn):
elasticsearch.Follow(username, config)
if config.Store_object:
follows_list.append(username)
if hasattr(config.Store_object_follow_list, 'append'):
config.Store_object_follow_list.append(username)
else:
follows_list.append(username) # twint.user.user
if config.Pandas:
logme.debug(__name__+':Username:object+pandas')
......
Markdown is supported
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