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)
# ------ 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")
)
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()
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),
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)
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)
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])
tweets_per_page = 24
total_pages = (len(self.json_path) + tweets_per_page - 1) // tweets_per_page
- html = "<html>\n"
- html = f"<!-- This document was generated by Wayback Tweets. Visit: https://claromes.github.io/waybacktweets -->\n"
+ html = "<!DOCTYPE html>\n"
+ html += '<html lang="en">\n'
+ html += "<!-- This document was generated by Wayback Tweets. Visit: https://claromes.github.io/waybacktweets -->\n"
- html += "\n<head>"
- html += '<meta charset="utf-8" />\n'
- html += '<meta name="viewport" content="width=device-width, initial-scale=1">\n'
+ html += "<head>"
+ html += '<meta charset="UTF-8">\n'
+ html += (
+ '<meta name="viewport" content="width=device-width, initial-scale=1.0">\n'
+ )
html += f"<title>@{self.username}'s archived tweets</title>\n"
# Adds styling
"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 += "</style>\n"
total_pages=total_pages
)
- html += "</body>\n</html>"
+ html += "</body>\n"
+ html += "</html>"
return html