Commit bf9e9693 authored by Francesco Poldi's avatar Francesco Poldi

Profile option for userlist #124

parent 7a43f9a7
...@@ -60,15 +60,18 @@ def check(args): ...@@ -60,15 +60,18 @@ def check(args):
if args.proxy_port or args.proxy_type: if args.proxy_port or args.proxy_type:
error("Error", "Please specify --proxy-host, --proxy-port, and --proxy-type") error("Error", "Please specify --proxy-host, --proxy-port, and --proxy-type")
def loadUserList(ul): def loadUserList(ul, type):
if os.path.exists(os.path.abspath(ul)): if os.path.exists(os.path.abspath(ul)):
userlist = open(os.path.abspath(ul), "r").read().splitlines() userlist = open(os.path.abspath(ul), "r").read().splitlines()
else: else:
userlist = ul.split(",") userlist = ul.split(",")
if type == "search":
un = "" un = ""
for user in userlist: for user in userlist:
un += "%20OR%20from%3A" + user un += "%20OR%20from%3A" + user
return un[15:] return un[15:]
else:
return userlist
def initialize(args): def initialize(args):
c = twint.Config() c = twint.Config()
...@@ -155,7 +158,7 @@ def main(): ...@@ -155,7 +158,7 @@ def main():
check(args) check(args)
if args.userlist: if args.userlist:
args.username = loadUserList(args.userlist) args.username = loadUserList(args.userlist, "search")
c = initialize(args) c = initialize(args)
...@@ -166,6 +169,10 @@ def main(): ...@@ -166,6 +169,10 @@ def main():
elif args.followers: elif args.followers:
twint.run.Followers(c) twint.run.Followers(c)
elif args.retweets or args.profile_full: elif args.retweets or args.profile_full:
_userlist = loadUserList(args.userlist, "profile")
for _user in _userlist:
args.username = _user
c = initialize(args)
twint.run.Profile(c) twint.run.Profile(c)
else: else:
twint.run.Search(c) twint.run.Search(c)
......
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