Commit 6e484b55 authored by andytnt's avatar andytnt

Fix search query

parent a937c8fc
......@@ -106,6 +106,7 @@ def initialize(args):
c.Proxy_type = args.proxy_type
c.ES_count = {"likes":True, "replies":True, "retweets":True}
c.Retweets = args.retweets
c.Query = args.query
return c
def options():
......@@ -187,6 +188,7 @@ def options():
ap.add_argument("--replies", help="Display replies to a subject.", action="store_true")
ap.add_argument("-pc", "--pandas-clean",
help="Automatically clean Pandas dataframe at every scrape.")
ap.add_argument("--query", help="Search query")
args = ap.parse_args()
return args
......@@ -198,7 +200,7 @@ def main():
check(args)
if args.userlist:
args.username = loadUserList(args.userlist, "search")
args.query = loadUserList(args.userlist, "search")
if args.pandas_clean:
twint.storage.panda.clean()
......
......@@ -56,3 +56,4 @@ class Config:
Proxy_port = 0
Proxy_type = None
Retweets = False
Query = None
......@@ -67,6 +67,8 @@ async def Search(config, init):
if config.Lang:
params.append(("l", config.Lang))
params.append(("lang", "en"))
if config.Query:
q += f"from:{config.Query}"
if config.Username:
q += f"from:{config.Username}"
if config.Geo:
......
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