From: Claromes Date: Sat, 8 Feb 2025 03:42:41 +0000 (-0300) Subject: update feedback msgs and set verbose to false X-Git-Url: https://git.claromes.com/?a=commitdiff_plain;h=46872ddae5f5ddf51cf2970dd91d542a7d1b0e6c;p=waybacktweets.git update feedback msgs and set verbose to false --- diff --git a/app/app.py b/app/app.py index 1100daa..58e5e4a 100644 --- a/app/app.py +++ b/app/app.py @@ -274,7 +274,7 @@ if (st.session_state.query and username) or st.session_state.count: st.stop() with st.spinner( - f"Parsing @{st.session_state.current_username}'s archived tweets" + f"Parsing the archived tweets of @{st.session_state.current_username}" ): parsed_tweets = tweets_parser( wayback_tweets, st.session_state.current_username, FIELD_OPTIONS diff --git a/waybacktweets/_cli.py b/waybacktweets/_cli.py index 0b9aa9a..9c78349 100644 --- a/waybacktweets/_cli.py +++ b/waybacktweets/_cli.py @@ -39,7 +39,10 @@ def _parse_date( raise click.BadParameter("Date must be in format YYYYmmdd") -@click.command(context_settings={"help_option_names": ["-h", "--help"]}) +@click.command( + context_settings={"help_option_names": ["-h", "--help"]}, + epilog="Check out our docs at https://claromes.github.io/waybacktweets for more details", # noqa: E501 +) @click.argument("username", type=str) @click.option( "-c", @@ -111,7 +114,7 @@ def main( """ Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing, and saves the data. - USERNAME: The Twitter username without @. + USERNAME: The Twitter username without @ """ # noqa: E501 try: config.verbose = verbose @@ -158,7 +161,3 @@ def main( exporter.save_to_html() except Exception as e: rprint(f"[red]{e}") - finally: - rprint( - "[yellow]\nNeed help? Read the docs: https://claromes.github.io/waybacktweets" # noqa: E501 - ) diff --git a/waybacktweets/api/parse.py b/waybacktweets/api/parse.py index 16e645f..35f26ba 100644 --- a/waybacktweets/api/parse.py +++ b/waybacktweets/api/parse.py @@ -201,10 +201,6 @@ class TweetsParser: resumption_key = self.archived_tweets_response[-1][0] self.parsed_tweets["resumption_key"].append(resumption_key) - rprint( - f'[blue]\nResumption Key: [bold]{resumption_key}[/bold]\nIf you are using the "limit" (--limit, -l) option and your query is too long, use this key in the "resumption key" (--resumption_key, -rk) option to continue the query from where the previous one ended.\n' # noqa: E501 - ) - def _add_field(self, key: str, value: Any) -> None: """ Appends a value to a list in the parsed data structure. @@ -306,7 +302,7 @@ class TweetsParser: task = None if print_progress: task = progress.add_task( - f"Parsing @{self.username}'s archived tweets\n", + f"Parsing the archived tweets of @{self.username}\n", total=len(futures), ) @@ -321,4 +317,8 @@ class TweetsParser: if print_progress: progress.update(task, advance=1) + rprint( + f"[blue]Resumption Key: [bold]{self.archived_tweets_response[-1][0]}[/bold]\nUse the Resumption Key (--resumption_key, -rk) option to continue the query from where the previous one ended. This allows you to break a large query into smaller queries more efficiently.[/blue]\n" # noqa: E501 + ) + return self.parsed_tweets diff --git a/waybacktweets/config/config.py b/waybacktweets/config/config.py index ae986be..0da3029 100644 --- a/waybacktweets/config/config.py +++ b/waybacktweets/config/config.py @@ -16,7 +16,7 @@ class _Config: verbose (bool): Determines if verbose logging should be enabled. """ - verbose: bool = True + verbose: bool = False config = _Config()