Commit beebeb48 authored by Francesco Poldi's avatar Francesco Poldi

Added filters for min retweets/likes/replies

parent 41ad8e8a
VERSION = (1, 2, 7)
VERSION = (1, 3, 0)
__version__ = '.'.join(map(str, VERSION))
......@@ -116,6 +116,9 @@ def initialize(args):
c.Skip_certs = args.skip_certs
c.Hide_output = args.hide_output
c.Native_retweets = args.native_retweets
c.Min_likes = args.min_likes
c.Min_retweets = args.min_retweets
c.Min_replies = args.min_replies
return c
def options():
......@@ -202,6 +205,9 @@ def options():
ap.add_argument("-sc", "--skip-certs", help="Skip certs verification, useful for SSC.", action="store_false")
ap.add_argument("-ho", "--hide-output", help="Hide output, no tweets will be displayed.", action="store_true")
ap.add_argument("-nr", "--native-retweets", help="Filter the results for retweets only.", action="store_true")
ap.add_argument("--min-likes", help="Filter the tweets by minimum number of likes")
ap.add_argument("--min-retweets", help="Filter the tweets by minimum number of retweets")
ap.add_argument("--min-replies", help="Filter the tweets by minimum number of replies")
args = ap.parse_args()
return args
......
......@@ -65,4 +65,7 @@ class Config:
Custom_query = ""
Popular_tweets = False
Skip_certs = False
Native_retweets = False
\ No newline at end of file
Native_retweets = False
c.Min_likes = 0
c.Min_retweets = 0
c.Min_replies = 0
\ No newline at end of file
......@@ -111,6 +111,12 @@ async def Search(config, init):
q += " filter:replies"
if config.Native_retweets:
q += " filter:nativeretweets"
if config.Min_likes:
q += f" min_favs:{config.Min_likes}"
if config.Min_retweets:
q += f" min_retweets:{config.Min_retweets}"
if config.Min_replies:
q += f" min_replies:{config.Min_replies}"
if 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