Commit 574805b3 authored by Francesco Poldi's avatar Francesco Poldi

Added native_retweets #492

parent c081834c
VERSION = (1, 2, 6)
VERSION = (1, 2, 7)
__version__ = '.'.join(map(str, VERSION))
......@@ -115,6 +115,7 @@ def initialize(args):
c.Popular_tweets = args.popular_tweets
c.Skip_certs = args.skip_certs
c.Hide_output = args.hide_output
c.Native_retweets = args.native_retweets
return c
def options():
......@@ -200,6 +201,7 @@ def options():
ap.add_argument("-pt", "--popular-tweets", help="Scrape popular tweets instead of recent ones.", action="store_true")
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")
args = ap.parse_args()
return args
......
......@@ -64,4 +64,5 @@ class Config:
Near = ""
Custom_query = ""
Popular_tweets = False
Skip_certs = False
\ No newline at end of file
Skip_certs = False
Native_retweets = False
\ No newline at end of file
......@@ -32,7 +32,7 @@ def Tweet(config, t):
logme.debug(__name__+':Tweet:notFormat')
output = f"{t.id_str} {t.datestamp} {t.timestamp} {t.timezone} "
if t.retweet == 1:
if t.retweet:
output += "RT "
output += f"<{t.username}> {t.tweet}"
......
......@@ -92,7 +92,8 @@ def Tweet(tw, config):
t.likes_count = getStat(tw, "favorite")
t.link = f"https://twitter.com/{t.username}/status/{t.id}"
t.retweet = getRetweet(config.Profile, t.username, config.Username)
if t.retweet:
if t.retweet or config.Native_retweets:
t.retweet = True
t.user_rt_id = config.User_id
else:
t.user_rt_id = 0
......
......@@ -109,6 +109,8 @@ async def Search(config, init):
q += " filter:media"
if config.Replies:
q += " filter:replies"
if config.Native_retweets:
q += " filter:nativeretweets"
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