From: claromes Date: Mon, 26 May 2025 04:34:34 +0000 (-0300) Subject: update docs and fix app image X-Git-Url: https://git.claromes.com/?a=commitdiff_plain;h=48dff57bfd31a04008326c4cdf7942248bc8fd42;p=waybacktweets.git update docs and fix app image --- diff --git a/README.md b/README.md index 20265b3..fc497a3 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,12 @@ Retrieves archived tweets CDX data from the Wayback Machine, performs necessary ## Installation -Python 3.10+ is required to install `waybacktweets`. +It is compatible with Python versions 3.10 and above. [See installation options](https://waybacktweets.claromes.com/installation). ```shell pipx install waybacktweets ``` -[Read more about the installation options](https://waybacktweets.claromes.com/installation). - ## CLI ```shell @@ -43,11 +41,14 @@ Options: -v, --verbose Shows the log. --version Show the version and exit. -h, --help Show this message and exit. + Examples: waybacktweets jack waybacktweets --from 20200305 --to 20231231 --limit 300 --verbose jack + Repository: https://github.com/claromes/waybacktweets + Documentation: https://waybacktweets.claromes.com ``` @@ -102,13 +103,13 @@ Important: Starting from version 1.0, the web app will no longer receive all upd ## Documentation -- [Wayback Tweets documentation](https://waybacktweets.claromes.com/) -- [Wayback CDX Server API (Beta) documentation](https://archive.org/developers/wayback-cdx-server.html) +- [Wayback Tweets documentation](https://waybacktweets.claromes.com/). +- [Wayback CDX Server API (Beta) documentation](https://archive.org/developers/wayback-cdx-server.html). ## Acknowledgements - Tristan Lee (Bellingcat's Data Scientist) for the idea. -- Jessica Smith (Snowflake's Community Growth Specialist) and Streamlit/Snowflake team for the additional server resources on Streamlit Cloud. +- Jessica Smith (Snowflake's Community Growth Specialist) and Streamlit team for the additional server resources on Streamlit Cloud. - OSINT Community for recommending the package and the application. ## License diff --git a/app/app.py b/app/app.py index 23fdd23..a8fd1fe 100644 --- a/app/app.py +++ b/app/app.py @@ -103,6 +103,9 @@ st.html( div[class="st-emotion-cache-1v0mbdj e115fcil1"] { max-width: 100%; } + div[data-testid="stElementToolbarButtonContainer"] { + display: none; + } """ ) @@ -176,7 +179,7 @@ if st.query_params.username != "": # ------ UI Settings ------ # -st.image(TITLE, use_container_width="never") +st.image(TITLE, width=None) st.write( "Retrieves archived tweets CDX data in HTML, CSV, and JSON formats." # noqa: E501 ) @@ -211,7 +214,7 @@ st.caption( limit = st.text_input( "Limit", key="limit", - help="Query result limits", + help="Query result limits (int)", ) unique = st.checkbox( diff --git a/docs/api.rst b/docs/api.rst index 6a5a2b4..a1236c0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,3 +1,5 @@ +.. _api: + API ==== diff --git a/docs/outputs.rst b/docs/outputs.rst index 7b700d0..6654218 100644 --- a/docs/outputs.rst +++ b/docs/outputs.rst @@ -16,6 +16,8 @@ This format allows for easy viewing of the archived tweets, through the use of t - ``parsed_tweet_url``: (`str`) The original tweet URL after parsing. Old URLs were archived in a nested manner. The parsing applied here unnests these URLs when necessary. Refer to the :ref:`utils` for more details. +If you want to define which viewing options should be displayed in the HTML file, you need to use the package as a module and specify the desired view in the field options. See the :ref:`api` Reference and the :ref:`module` usage example. + Additionally, other fields are displayed. .. note:: diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 209b11a..2a82406 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -12,6 +12,8 @@ waybacktweets [OPTIONS] USERNAME waybacktweets --from 20150101 --to 20191231 --limit 250 jack +.. _module: + Module ------------- diff --git a/pyproject.toml b/pyproject.toml index 2d6f4d8..974162e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "waybacktweets" -version = "1.0" +version = "1.0rc1" description = "Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing, and saves the data." authors = ["Claromes "] license = "GPLv3" diff --git a/waybacktweets/_cli.py b/waybacktweets/_cli.py index 1862e65..aacf4df 100644 --- a/waybacktweets/_cli.py +++ b/waybacktweets/_cli.py @@ -38,15 +38,18 @@ class CustomCommand(click.Command): formatter.write_text(" USERNAME: The Twitter username without @") self.format_options(ctx, formatter) + formatter.write("\n") formatter.write_heading("Examples") formatter.write_text(" waybacktweets jack") formatter.write_text( " waybacktweets --from 20200305 --to 20231231 --limit 300 --verbose jack" ) + formatter.write("\n") formatter.write_heading("Repository") formatter.write_text(" https://github.com/claromes/waybacktweets") + formatter.write("\n") formatter.write_heading("Documentation") formatter.write_text(" https://waybacktweets.claromes.com") diff --git a/waybacktweets/api/parse.py b/waybacktweets/api/parse.py index 00cdc89..ba4e8a0 100644 --- a/waybacktweets/api/parse.py +++ b/waybacktweets/api/parse.py @@ -321,7 +321,7 @@ class TweetsParser: if self.show_resume_key: rprint( - f'[blue]Resumption Key: [bold]{self.archived_tweets_response[-1][0]}[/bold][/blue]\nUse this Resumption Key option (--resumption_key in the CLI or "resumption_key" in field_options via the API) to continue the query from where the previous one left off. This allows you to split a large query into smaller, more efficient ones.\n' # noqa: E501 + f'[blue]Resumption Key: [bold]{self.archived_tweets_response[-1][0]}[/bold][/blue]\nUse this Resumption Key option (--resumption_key in the CLI or "resumption_key" in the Module) to continue the query from where the previous one left off. This allows you to split a large query into smaller, more efficient ones.\n' # noqa: E501 ) return self.parsed_tweets