Commit bf9e9693 authored by Francesco Poldi's avatar Francesco Poldi

Profile option for userlist #124

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