Commit 7262bd3a authored by Francesco Poldi's avatar Francesco Poldi

Added filter_retweets

parent df1cbffb
...@@ -122,6 +122,7 @@ def initialize(args): ...@@ -122,6 +122,7 @@ def initialize(args):
c.Links = args.links c.Links = args.links
c.Source = args.source c.Source = args.source
c.Members_list = args.members_list c.Members_list = args.members_list
c.Filter_retweets = args.filter_retweets
return c return c
def options(): def options():
...@@ -215,6 +216,7 @@ def options(): ...@@ -215,6 +216,7 @@ def options():
" you will get both tweets that might contain links or not.") " you will get both tweets that might contain links or not.")
ap.add_argument("--source", help="Filter the tweets for specific source client.") ap.add_argument("--source", help="Filter the tweets for specific source client.")
ap.add_argument("--members-list", help="Filter the tweets sent by users in a given list.") ap.add_argument("--members-list", help="Filter the tweets sent by users in a given list.")
ap.add_argument("-fr", "--filter-retweets", help="Exclude retweets from the results.", action="store_true")
args = ap.parse_args() args = ap.parse_args()
return args return args
......
...@@ -71,4 +71,5 @@ class Config: ...@@ -71,4 +71,5 @@ class Config:
Min_replies = 0 Min_replies = 0
Links = None Links = None
Source = None Source = None
Members_list = None Members_list = None
\ No newline at end of file Filter_retweets = False
\ No newline at end of file
...@@ -125,6 +125,8 @@ async def Search(config, init): ...@@ -125,6 +125,8 @@ async def Search(config, init):
q += f" source:\"{config.Source}\"" q += f" source:\"{config.Source}\""
if config.Members_list: if config.Members_list:
q += f" list:{config.Members_list}" q += f" list:{config.Members_list}"
if config.Filter_retweets:
q += f" exclude:nativeretweets exclude:retweets"
if config.Custom_query: if config.Custom_query:
q = config.Custom_query q = config.Custom_query
......
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