adding the twitter username utilisation if asked, and the possibility of scrap tweets with no limits (even tho the limitation will be the numbers of tweets that the browser is able to handle)
This commit is contained in:
@@ -7,7 +7,7 @@ class Progress:
|
||||
self.total = total
|
||||
pass
|
||||
|
||||
def print_progress(self, current) -> None:
|
||||
def print_progress(self, current, waiting, retry_cnt, no_tweets_limit) -> None:
|
||||
self.current = current
|
||||
progress = current / self.total
|
||||
bar_length = 40
|
||||
@@ -17,9 +17,30 @@ class Progress:
|
||||
+ "-" * (bar_length - int(bar_length * progress))
|
||||
+ "]"
|
||||
)
|
||||
sys.stdout.write(
|
||||
"\rProgress: [{:<40}] {:.2%} {} of {}".format(
|
||||
progress_bar, progress, current, self.total
|
||||
)
|
||||
)
|
||||
if no_tweets_limit:
|
||||
if waiting:
|
||||
sys.stdout.write(
|
||||
"\rTweets scrapped : {} - waiting to access older tweets {} min on 15 min".format(
|
||||
current, retry_cnt
|
||||
)
|
||||
)
|
||||
else:
|
||||
sys.stdout.write(
|
||||
"\rTweets scrapped : {} ".format(
|
||||
current
|
||||
)
|
||||
)
|
||||
else:
|
||||
if waiting:
|
||||
sys.stdout.write(
|
||||
"\rProgress: [{:<40}] {:.2%} {} of {} - waiting to access older tweets {} min on 15 min".format(
|
||||
progress_bar, progress, current, self.total, retry_cnt
|
||||
)
|
||||
)
|
||||
else:
|
||||
sys.stdout.write(
|
||||
"\rProgress: [{:<40}] {:.2%} {} of {} ".format(
|
||||
progress_bar, progress, current, self.total
|
||||
)
|
||||
)
|
||||
sys.stdout.flush()
|
||||
|
||||
Reference in New Issue
Block a user