Skip to content

Commit

Permalink
Merge pull request #15 from claromes/tweets-page
Browse files Browse the repository at this point in the history
Update tweets page
  • Loading branch information
claromes authored Dec 13, 2023
2 parents 5824720 + fc4c23b commit c603f90
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Tool that displays, via [Wayback CDX Server API](https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server), multiple archived tweets on Wayback Machine to avoid opening each link manually. The app is a prototype written in Python with Streamlit and hosted at Streamlit Cloud with an extra 7 GiB provided free of charge by the Streamlit team (special thanks to Jessica Smith).

Users can define the number of tweets displayed per page and apply filters based on specific years. Additionally, users can filter and view tweets that lack the original URL.
Users can apply filters based on specific years and view tweets that lack the original URL.

*Thanks Tristan Lee for the idea.*

Expand Down
10 changes: 6 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[![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)
Tool that displays, via Wayback CDX Server API, multiple archived tweets on Wayback Machine to avoid opening each link manually. Users can define the number of tweets displayed per page and apply filters based on specific years. There is also an option to filter and view tweets that do not have the original URL available.
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 and maintained by [@claromes](https://github.com/claromes).
Expand Down Expand Up @@ -279,6 +279,9 @@ def display_not_tweet():

response_html = requests.get(original_link)

if response_html.status_code not in range(200, 399):
st.warning('HTTP ERROR')

if mimetype[i] == 'text/html' or mimetype[i] == 'warc/revisit' or mimetype[i] == 'unk':
if ('.jpg' in tweet_links[i] or '.png' in tweet_links[i]) and response_html.status_code == 200:
components.iframe(tweet_links[i], height=500, scrolling=True)
Expand Down Expand Up @@ -342,15 +345,13 @@ def next_page():
scroll_into_view()

# UI
st.title('Wayback Tweets [![Star](https://img.shields.io/github/stars/claromes/waybacktweets?style=social)](https://github.com/claromes/waybacktweets)', anchor=False)
st.title('Wayback Tweets [![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)', anchor=False)
st.write('Display multiple archived tweets on Wayback Machine and avoid opening each link manually')

handle = st.text_input('Username', placeholder='jack')

st.session_state.saved_at = st.slider('Tweets saved between', 2006, year, (2006, year))

tweets_per_page = st.slider('Tweets per page', 25, 250, 25, 25)

not_available = st.checkbox('Original URLs not available', help='Due to changes in X, it is possible to find available tweets if you are logged into X')

query = st.button('Query', type='primary', use_container_width=True)
Expand All @@ -360,6 +361,7 @@ def next_page():
st.session_state.offset = 0

if query or st.session_state.count:
tweets_per_page = 25

st.session_state.count = tweets_count(handle, st.session_state.saved_at)

Expand Down
18 changes: 17 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [v0.4.1](https://github.com/claromes/waybacktweets/releases/tag/v0.4) - 2023-12-13
- Add:
- Warning message for non 200/300 status code
- Update:
- Set a fixed tweets per page (25) due the API rate limit

## [v0.4](https://github.com/claromes/waybacktweets/releases/tag/v0.4) - 2023-12-13
- Add:
- Parse old tweets URLs
- Picture: `twimg.com`
- Reply `username/status/"/user_reply/status/user_reply_msg_ID"`
- Allows MIME type `warc/revisit` and `unk` (**to be reviewed**)

- Update:
- Change filter text "Only deleted tweets" to "Original URLs not available" with a help info
- Change "tweet" text to "original link" on each header

## [v0.3](https://github.com/claromes/waybacktweets/releases/tag/v0.3) - 2023-11-13
- Add:
- Add filter by year
Expand All @@ -20,7 +37,6 @@
Progress bar

## [v0.2](https://github.com/claromes/waybacktweets/releases/tag/v0.2) - 2023-08-16

- Displays tweets as text
- Displays RTs info
- Displays JSON MIME type as JSON (if tweet was deleted)
Expand Down

0 comments on commit c603f90

Please sign in to comment.