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: ...@@ -37,6 +37,8 @@ class Config:
Profile_full = False Profile_full = False
Store_object = False Store_object = False
Store_object_tweets_list = None Store_object_tweets_list = None
Store_object_users_list = None
Store_object_follow_list = None
Pandas_type = None Pandas_type = None
Pandas = False Pandas = False
Index_tweets = "twinttweets" Index_tweets = "twinttweets"
...@@ -73,4 +75,4 @@ class Config: ...@@ -73,4 +75,4 @@ class Config:
Filter_retweets = False Filter_retweets = False
Translate = False Translate = False
TranslateSrc = "en" TranslateSrc = "en"
TranslateDest = "en" TranslateDest = "en"
\ No newline at end of file
...@@ -175,8 +175,19 @@ async def Users(u, config, conn): ...@@ -175,8 +175,19 @@ async def Users(u, config, conn):
if config.Store_object: if config.Store_object:
logme.debug(__name__+':User:Store_object') logme.debug(__name__+':User:Store_object')
users_list.append(user) # twint.user.user
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: if config.Pandas:
logme.debug(__name__+':User:Pandas+user') logme.debug(__name__+':User:Pandas+user')
panda.update(obj, config) panda.update(obj, config)
...@@ -198,7 +209,10 @@ async def Username(username, config, conn): ...@@ -198,7 +209,10 @@ async def Username(username, config, conn):
elasticsearch.Follow(username, config) elasticsearch.Follow(username, config)
if config.Store_object: 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: if config.Pandas:
logme.debug(__name__+':Username:object+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