Commit edb00491 authored by Francesco Poldi's avatar Francesco Poldi

Added Custom_query

parent 14e0bf7a
...@@ -106,6 +106,7 @@ def initialize(args): ...@@ -106,6 +106,7 @@ def initialize(args):
c.Proxy_type = args.proxy_type c.Proxy_type = args.proxy_type
c.Retweets = args.retweets c.Retweets = args.retweets
c.Get_replies = args.get_replies c.Get_replies = args.get_replies
c.Custom_query = args.custom_query
return c return c
def options(): def options():
...@@ -187,6 +188,7 @@ def options(): ...@@ -187,6 +188,7 @@ def options():
ap.add_argument("-pc", "--pandas-clean", ap.add_argument("-pc", "--pandas-clean",
help="Automatically clean Pandas dataframe at every scrape.") help="Automatically clean Pandas dataframe at every scrape.")
ap.add_argument("--get-replies", help="All replies to the tweet.", action="store_true") ap.add_argument("--get-replies", help="All replies to the tweet.", action="store_true")
ap.add_argument("-cq", "--custom-query", help="Custom search query.")
args = ap.parse_args() args = ap.parse_args()
return args return args
......
...@@ -63,3 +63,4 @@ class Config: ...@@ -63,3 +63,4 @@ class Config:
Hide_output = False Hide_output = False
Get_replies = False Get_replies = False
Near = "" Near = ""
Custom_query = ""
\ No newline at end of file
...@@ -101,6 +101,8 @@ async def Search(config, init): ...@@ -101,6 +101,8 @@ async def Search(config, init):
q += " filter:media" q += " filter:media"
if config.Replies: if config.Replies:
q += " filter:replies" q += " filter:replies"
if config.Custom_query:
q = config.Custom_query
params.append(("q", q)) params.append(("q", q))
return url, params return url, params
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