From: Claromes Date: Mon, 24 Jun 2024 19:47:08 +0000 (-0300) Subject: update docs, fiz viz class X-Git-Url: https://git.claromes.com/?a=commitdiff_plain;h=dae9e34c92775d1c9e93c3735d3f103f488e5e10;p=waybacktweets.git update docs, fiz viz class --- diff --git a/app/app.py b/app/app.py index 379c892..50ebe1f 100644 --- a/app/app.py +++ b/app/app.py @@ -17,7 +17,7 @@ DOWNLOAD = "assets/download.svg" collapse = None matchtype = None -start_date = datetime.now() - timedelta(days=365 * 2) +start_date = datetime.now() - timedelta(days=30 * 6) end_date = datetime.now() min_date = datetime(2006, 1, 1) @@ -126,7 +126,7 @@ def tweets_exporter(parsed_tweets, username, field_options): # ------ User Interface Settings ------ # st.info( - """🥳 [**Pre-release 1.0x: New Streamlit app, CLI and Python module**](https://claromes.github.io/waybacktweets)""" # noqa: E501 + "🥳 [**Pre-release 1.0a5: Python module, CLI, and new Streamlit app**](https://github.com/claromes/waybacktweets/releases/tag/v1.0a5)" # noqa: E501 ) st.image(TITLE, use_column_width="never") @@ -138,11 +138,11 @@ st.write( ) st.write( - "This application uses the Wayback Tweets Python package, which can be used as a module or as a standalone command line tool. [Read the documentation](https://claromes.github.io/waybacktweets)." # noqa: E501 + "This application uses the Wayback Tweets Python package, which can be used either as a module or as a standalone command-line tool. [Read the documentation](https://claromes.github.io/waybacktweets) for more information.." # noqa: E501 ) st.write( - "To access the legacy version of Wayback Tweets [click here](https://waybacktweets-legacy.streamlit.app)." # noqa: E501 + "To access the legacy version of Wayback Tweets, [click here](https://waybacktweets-legacy.streamlit.app)." # noqa: E501 ) st.divider() @@ -153,9 +153,6 @@ username = st.text_input("Username *", key="username", placeholder="Without @") with st.expander("Filtering"): - st.caption( - ":orange[A large date range takes a long time to process, and the app's resources may not be sufficient. Try to perform searches with smaller ranges to get faster results.]" # noqa: E501 - ) st.session_state.archived_timestamp_filter = st.date_input( "Tweets saved between", (start_date, end_date), @@ -164,6 +161,9 @@ with st.expander("Filtering"): format="YYYY/MM/DD", help="Using the `from` and `to` filters. Format: YYYY/MM/DD", ) + st.caption( + ":orange[note: large date range takes a long time to process, and the app's resources may not be sufficient. Try to perform searches with smaller ranges to get faster results.]" # noqa: E501 + ) col1, col2 = st.columns(2) @@ -186,6 +186,9 @@ with st.expander("Filtering"): key="unique", help="Filtering by the collapse option using the `urlkey` field and the URL Match Scope `prefix`", # noqa: E501 ) + st.caption( + ":orange[note: according to the official documentation of the Wayback CDX Server API, the query to retrieve unique URLs may be slow at the moment.]" # noqa: E501 + ) query = st.button("Query", type="primary", use_container_width=True) @@ -244,7 +247,7 @@ if query or st.session_state.count: st.header("HTML", divider="gray") st.write( - f"Visualize tweets more efficiently through iframes. Download the @{st.session_state.current_username}'s archived tweets in HTML." # noqa: E501 + f"Visualize tweets more efficiently through `iframes`. Download the @{st.session_state.current_username}'s archived tweets in HTML." # noqa: E501 ) col5, col6 = st.columns([1, 18]) diff --git a/app/requirements.txt b/app/requirements.txt index 9d8ab55..54dfe4d 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,2 +1,2 @@ streamlit==1.36.0 -waybacktweets==1.0a3 +waybacktweets==1.0a5 diff --git a/pyproject.toml b/pyproject.toml index f3ccec6..4467d49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "waybacktweets" -version = "1.0a4" +version = "1.0a5" 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/api/visualize.py b/waybacktweets/api/visualize.py index 6621667..93ad80a 100644 --- a/waybacktweets/api/visualize.py +++ b/waybacktweets/api/visualize.py @@ -57,12 +57,15 @@ class HTMLTweetsVisualizer: tweets_per_page = 24 total_pages = (len(self.json_path) + tweets_per_page - 1) // tweets_per_page - html = "\n" - html = f"\n" + html = "\n" + html += '\n' + html += "\n" - html += "\n" - html += '\n' - html += '\n' + html += "" + html += '\n' + html += ( + '\n' + ) html += f"@{self.username}'s archived tweets\n" # Adds styling @@ -85,7 +88,7 @@ class HTMLTweetsVisualizer: "input:checked ~ .accordion-content { max-height: 100vh; padding: 1em; }\n" ) html += ".pagination { text-align: center; margin-top: 20px; }\n" - html += ".pagination a { margin: 0 5px; text-decoration: none; color: #000000; padding: 10px 15px; border: 1px solid #e2e2e2; border-radius: 5px; }\n" + html += ".pagination a { margin: 0 5px; text-decoration: none; color: #000000; padding: 1px 2px; border-radius: 5px; }\n" html += ".pagination a:hover { background-color: #e2e2e2; }\n" html += ".pagination a.selected { background-color: #e2e2e2; color: #000000; font-weight: bold; }\n" html += "\n" @@ -202,7 +205,8 @@ class HTMLTweetsVisualizer: total_pages=total_pages ) - html += "\n" + html += "\n" + html += "" return html