app - add tabs, lagacy app - update descriptions, module - update CLI help text,...
authorClaromes <claromes@hey.com>
Thu, 4 Jul 2024 19:04:08 +0000 (16:04 -0300)
committerClaromes <claromes@hey.com>
Thu, 4 Jul 2024 19:04:08 +0000 (16:04 -0300)
README.md
app/app.py
docs/conf.py
docs/handson.rst [new file with mode: 0644]
docs/index.rst
legacy_app/legacy_app.py
poetry.lock
pyproject.toml
waybacktweets/_cli.py

index 2bd1b232e3e0d6db2d49e5c63a0fbed81b03b047..8668792c6860ee625798ffacb0b8c6238ea41a50 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
 # Wayback Tweets
 
-[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12528448.svg)](https://doi.org/10.5281/zenodo.12528448) [![PyPI](https://img.shields.io/pypi/v/waybacktweets)](https://pypi.org/project/waybacktweets) [![docs](https://github.com/claromes/waybacktweets/actions/workflows/docs.yml/badge.svg)](https://github.com/claromes/waybacktweets/actions/workflows/docs.yml) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://waybacktweets.streamlit.app)
+[![PyPI](https://img.shields.io/pypi/v/waybacktweets)](https://pypi.org/project/waybacktweets) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12528448.svg)](https://doi.org/10.5281/zenodo.12528448) [![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://waybacktweets.streamlit.app) [![Open In Collab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1zRqi6uTMiGi5z8GQ-PC0tbpCJWULCqMO?usp=sharing)
 
-Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing (see [Field Options](https://claromes.github.io/waybacktweets/field_options.html)), and saves the data in HTML (for easy viewing of the tweets using the `iframe` tag), CSV, and JSON formats.
+
+Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing (see [Field Options](https://claromes.github.io/waybacktweets/field_options.html)), and saves the data in HTML, for easy viewing of the tweets using the iframe tags, CSV, and JSON formats.
 
 ## Installation
 
@@ -57,7 +58,7 @@ if archived_tweets:
 ## Acknowledgements
 
 - Tristan Lee (Bellingcat's Data Scientist) for the idea of the application.
-- Jessica Smith (Snowflake's Marketing Specialist) and Streamlit/Snowflake teams for the additional server resources on Streamlit Cloud.
+- Jessica Smith (Snowflake's Community Growth Specialist) and Streamlit/Snowflake team for the additional server resources on Streamlit Cloud.
 - OSINT Community for recommending the application.
 
 > [!NOTE]
index df41e67f016109958bfd875488d35f55b42ec687..a608dadfb97df6860a23f30ef2927ff7595963bc 100644 (file)
@@ -34,7 +34,7 @@ st.set_page_config(
     layout="centered",
     menu_items={
         "About": f"""
-    [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/claromes/waybacktweets?include_prereleases)](https://github.com/claromes/waybacktweets/releases) [![License](https://img.shields.io/github/license/claromes/waybacktweets)](https://github.com/claromes/waybacktweets/blob/main/LICENSE.md) [![Star](https://img.shields.io/github/stars/claromes/waybacktweets?style=social)](https://github.com/claromes/waybacktweets)
+    [![License](https://img.shields.io/github/license/claromes/waybacktweets)](https://github.com/claromes/waybacktweets/blob/main/LICENSE.md)
 
     The application is a prototype hosted on Streamlit Cloud, serving as an alternative to the command line tool.
 
@@ -168,16 +168,12 @@ if st.query_params.username != "":
 
 # ------ User Interface Settings ------ #
 
-st.info(
-    "🥳 [**Pre-release 1.0x: Python module, CLI, and new Streamlit app**](https://github.com/claromes/waybacktweets/releases)"  # noqa: E501
-)
-
 st.image(TITLE, use_column_width="never")
 st.caption(
-    "[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/claromes/waybacktweets?include_prereleases)](https://github.com/claromes/waybacktweets/releases) [![Star](https://img.shields.io/github/stars/claromes/waybacktweets?style=social)](https://github.com/claromes/waybacktweets)"  # noqa: E501
+    "[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/claromes/waybacktweets?include_prereleases)](https://github.com/claromes/waybacktweets/releases) [![sponsor](https://img.shields.io/badge/Donate-via%20Sponsors-ff69b4.svg?logo=github)](https://github.com/sponsors/claromes)"  # noqa: E501
 )
 st.write(
-    "Retrieves archived tweets CDX data in HTML (for easy viewing of the tweets using the `iframe` tag), CSV, and JSON formats."  # noqa: E501
+    "Retrieves archived tweets CDX data in HTML (for easy viewing of the tweets using the iframe tag), CSV, and JSON formats."  # noqa: E501
 )
 
 st.write(
@@ -291,15 +287,15 @@ if st.session_state.query or st.session_state.count:
 
         # -- Rendering -- #
 
-        if csv_data and json_data and html_content:
-            st.session_state.count = len(df)
-            st.write(f"**{st.session_state.count} URLs have been captured**")
+        st.session_state.count = len(df)
+        st.write(f"**{st.session_state.count} URLs have been captured**")
 
-            # -- HTML -- #
+        tab1, tab2, tab3 = st.tabs(["HTML", "CSV", "JSON"])
 
-            st.header("HTML", divider="gray", anchor=False)
+        # -- HTML -- #
+        with tab1:
             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 iframe tags. Download the @{st.session_state.current_username}'s archived tweets in HTML."  # noqa: E501
             )
 
             col5, col6 = st.columns([1, 18])
@@ -317,8 +313,7 @@ if st.session_state.query or st.session_state.count:
                 )
 
             # -- CSV -- #
-
-            st.header("CSV", divider="gray", anchor=False)
+        with tab2:
             st.write(
                 "Check the data returned in the dataframe below and download the file."
             )
@@ -340,8 +335,7 @@ if st.session_state.query or st.session_state.count:
             st.dataframe(df, use_container_width=True)
 
             # -- JSON -- #
-
-            st.header("JSON", divider="gray", anchor=False)
+        with tab3:
             st.write(
                 "Check the data returned in JSON format below and download the file."
             )
index 4a4419eafc3b5e815042837af4d01149d246c3a7..b6304e95882ab03454c607cb64237b52443dad09 100644 (file)
@@ -20,6 +20,7 @@ extensions = [
     "sphinx_new_tab_link",
     "sphinx_click.ext",
     "sphinx_autodoc_typehints",
+    "sphinxcontrib.youtube",
 ]
 
 templates_path = ["_templates"]
diff --git a/docs/handson.rst b/docs/handson.rst
new file mode 100644 (file)
index 0000000..79ec10f
--- /dev/null
@@ -0,0 +1,22 @@
+Hands-On Examples
+====================
+
+- **Notebook**
+
+   This notebook demonstrates how to fetch, parse, and export archived tweets for a specific user using the ``waybacktweets`` library.
+
+   .. image:: https://colab.research.google.com/assets/colab-badge.svg
+      :target: https://colab.research.google.com/drive/1zRqi6uTMiGi5z8GQ-PC0tbpCJWULCqMO?usp=sharing
+      :alt: Open In Collab
+
+.. raw:: html
+
+   <br>
+   <br>
+
+- **Video**
+
+   Demonstration of how to use Wayback Tweets and other tools to retrieve tweets (in Spanish)
+
+   ..  youtube:: qy3wOnUxe6A
+      :width: 100%
index f6a5578aeddac9d23c93656998f35f80fdf28edb..300dec95475d5cc427363f8e09d6ec2b20fd03e5 100644 (file)
@@ -9,10 +9,11 @@ Wayback Tweets
 
 Pre-release: |release|
 
-Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing (see :ref:`field_options`), and saves the data in HTML (for easy viewing of the tweets using the ``iframe`` tag), CSV, and JSON formats.
+Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing (see :ref:`field_options`), and saves the data in HTML, for easy viewing of the tweets using the iframe tags, CSV, and JSON formats.
 
-.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.12528448.svg
-  :target: https://doi.org/10.5281/zenodo.12528448
+.. image:: https://img.shields.io/badge/Donate-via%20Sponsors-ff69b4.svg?logo=github
+  :target: https://github.com/sponsors/claromes
+  :alt: GitHub Sponsors
 
 .. note::
     Intensive queries can lead to rate limiting, resulting in a temporary ban of a few minutes from web.archive.org.
@@ -30,6 +31,7 @@ User Guide
     field_options
     outputs
     exceptions
+    handson
     contribute
     todo
 
index 82059a2717026a837c950a8c4d8966c09b7f5d10..ba2df0e5c4b2a056806b1e7aab4205256bc3bffc 100644 (file)
@@ -14,11 +14,7 @@ st.set_page_config(
     layout="centered",
     menu_items={
         "About": """
-        ## 🏛️ Wayback Tweets
-
-        Tool that displays, via Wayback CDX Server API, multiple archived tweets on Wayback Machine to avoid opening each link manually. Users can apply filters based on specific years and view tweets that do not have the original URL available.
-
-        This tool is a prototype, please feel free to send your [feedbacks](https://github.com/claromes/waybacktweets/issues). Created by [@claromes](https://claromes.com).
+        This is the legacy application of [Wayback Tweets](https://waybacktweets.streamlit.app/).
 
         -------
         """,  # noqa: E501
@@ -386,7 +382,7 @@ def next_page():
 
 # UI
 st.title(
-    "Wayback Tweets [![Star](https://img.shields.io/github/stars/claromes/waybacktweets?style=social)](https://github.com/claromes/waybacktweets)",  # noqa: E501
+    "Wayback Tweets",  # noqa: E501
     anchor=False,
     help="v0.4.3",
 )
index 825cb2ab49873ad19bd5e67812e94eb34cb921a8..05d1e4fde74a7409b1b1bd7d0021e47866d0d81e 100644 (file)
@@ -1524,6 +1524,26 @@ lint = ["docutils-stubs", "flake8", "mypy"]
 standalone = ["Sphinx (>=5)"]
 test = ["pytest"]
 
+[[package]]
+name = "sphinxcontrib-youtube"
+version = "1.4.1"
+description = "Sphinx \"youtube\" extension."
+optional = false
+python-versions = "*"
+files = [
+    {file = "sphinxcontrib_youtube-1.4.1-py2.py3-none-any.whl", hash = "sha256:de9cb454f066d580a1e7ad64efae7dd9e12c1b1567a31faa330b1aeaeed40460"},
+    {file = "sphinxcontrib_youtube-1.4.1.tar.gz", hash = "sha256:eb7871c8af47fd2b5c9727615354b7f95bce554be8be45b9fa8e5bc022f88059"},
+]
+
+[package.dependencies]
+requests = "*"
+Sphinx = ">=6.1"
+
+[package.extras]
+dev = ["nox"]
+doc = ["pydata-sphinx-theme", "sphinx-copybutton", "sphinx-design"]
+test = ["beautifulsoup4", "pytest", "pytest-cov", "pytest-regressions"]
+
 [[package]]
 name = "streamlit"
 version = "1.36.0"
@@ -1733,4 +1753,4 @@ watchmedo = ["PyYAML (>=3.10)"]
 [metadata]
 lock-version = "2.0"
 python-versions = "^3.10"
-content-hash = "4017fc7af7b13a774406ad205ef03952ef96dc5c3e0413c624c8a459e0619a4c"
+content-hash = "e41f880cd350ecafc461396adeec717dd632a56071c030fab761265acc0773f6"
index 9dbd986b8919fb1830d7c34d37bad3f1fdc744bc..7296f3a30df16d7b5c605adf2ea5e8e8f5f3d9b6 100644 (file)
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "waybacktweets"
-version = "1.0a6"
+version = "1.0a7"
 description = "Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing, and saves the data."
 authors = ["Claromes <support@claromes.com>"]
 license = "GPLv3"
@@ -46,6 +46,7 @@ sphinxcontrib-mermaid = "^0.9.2"
 sphinx-new-tab-link = "^0.4.0"
 sphinx-click = "^6.0.0"
 sphinx-autodoc-typehints = "^2.1.1"
+sphinxcontrib-youtube = "^1.4.1"
 
 [tool.poetry.group.dev.dependencies]
 streamlit = "1.36.0"
index 4048fc780def996c25f2ef3b5c861bbb944ae339..f003efcd23658eacffde0a1da22afed6c418b0e9 100644 (file)
@@ -97,7 +97,7 @@ def _parse_date(
     "verbose",
     is_flag=True,
     default=False,
-    help="Shows the error log.",
+    help="Shows the log.",
 )
 def main(
     username: str,