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
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",
"""
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
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
- )
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.
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),
)
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
verbose (bool): Determines if verbose logging should be enabled.
"""
- verbose: bool = True
+ verbose: bool = False
config = _Config()