Skip to content

Commit

Permalink
Merge pull request #28 from claromes/v1.0rc1
Browse files Browse the repository at this point in the history
v1.0rc1
  • Loading branch information
claromes authored Jul 20, 2024
2 parents 30a5cc6 + 955a5ab commit 0e7a3a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
22 changes: 9 additions & 13 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ def scroll_page():

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) [![sponsor](https://img.shields.io/badge/Donate-via%20Sponsors-ff69b4.svg?logo=github)](https://github.com/sponsors/claromes)" # 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) [![read the documentation](https://img.shields.io/badge/read_the-documentation-0a507a?logo=sphinx)](https://claromes.github.io/waybacktweets) [![sponsors](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), CSV, and JSON formats." # noqa: E501
)

st.write(
"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
"For better performance, use the CLI version, available on [PyPI](https://pypi.org/project/waybacktweets)." # noqa: E501
)

st.write(
Expand Down Expand Up @@ -246,27 +246,20 @@ def scroll_page():
if username != st.session_state.current_username:
st.session_state.current_username = username

if st.session_state.query or st.session_state.count:
if (st.session_state.query and username) or st.session_state.count:
if unique:
collapse = "urlkey"
matchtype = "prefix"

start_timestamp = None
end_timestamp = None

if st.session_state.archived_timestamp_filter:
start_timestamp = st.session_state.archived_timestamp_filter[0]
end_timestamp = st.session_state.archived_timestamp_filter[1]

try:
with st.spinner(
f"Waybacking @{st.session_state.current_username}'s archived tweets"
):
wayback_tweets = wayback_tweets(
st.session_state.current_username,
collapse,
start_timestamp,
end_timestamp,
st.session_state.archived_timestamp_filter[0],
st.session_state.archived_timestamp_filter[1],
limit,
offset,
matchtype,
Expand Down Expand Up @@ -370,6 +363,9 @@ def scroll_page():
If the problem persists [open an issue](https://github.com/claromes/waybacktweets/issues).""" # noqa: E501
)
st.stop()
except IndexError:
st.error("Please check if you have entered a date range in the filter.")
st.stop()
except Exception as e:
st.error(str(e))
st.stop()
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ 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 tags, CSV, and JSON formats.

.. image:: https://img.shields.io/badge/Donate-via%20Sponsors-ff69b4.svg?logo=github
.. image:: https://img.shields.io/badge/donate-via%20sponsors-ff69b4.svg?logo=github
:target: https://github.com/sponsors/claromes
:alt: GitHub Sponsors
:alt: sponsors

.. note::
Intensive queries can lead to rate limiting, resulting in a temporary ban of a few minutes from web.archive.org.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "waybacktweets"
version = "1.0rc"
version = "1.0rc1"
description = "Retrieves archived tweets CDX data from the Wayback Machine, performs necessary parsing, and saves the data."
authors = ["Claromes <[email protected]>"]
license = "GPLv3"
Expand Down

0 comments on commit 0e7a3a1

Please sign in to comment.