From: Claromes Date: Fri, 21 Jul 2023 05:01:44 +0000 (-0300) Subject: add pagination via api X-Git-Url: https://git.claromes.com/?a=commitdiff_plain;h=6cd95e28055100cd0cab6d8d01decdd20c272302;p=waybacktweets.git add pagination via api --- diff --git a/README.md b/README.md index 41f3004..63b6f3c 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,19 @@ [![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) -Tool that displays multiple archived tweets on Wayback Machine to avoid opening each link manually. +Tool that displays multiple archived tweets on Wayback Machine to avoid opening each link manually. Data via [Wayback CDX Server API](https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server). [waybacktweets.streamlit.app](https://waybacktweets.streamlit.app/) *Thanks Tristan Lee for the idea.* +## Features + +- 50 embed tweets per page +- Filter by only deleted tweets +- Wayback Machine link and original tweet link +- Datetime information + ## Development ### Requirement diff --git a/app.py b/app.py index e59dbf6..9ec6741 100644 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ import datetime import streamlit as st import streamlit.components.v1 as components -__version__ = '0.1.4-beta' +__version__ = '0.1.4' year = datetime.datetime.now().year @@ -22,17 +22,12 @@ st.set_page_config( This tool is experimental, please feel free to send your [feedbacks](https://github.com/claromes/waybacktweets/issues). - Copyright © {}, [claromes.gitlab.io](https://claromes.gitlab.io). - ------- '''.format(year), 'Report a bug': 'https://github.com/claromes/waybacktweets/issues' } ) -if 'current_index' not in st.session_state: - st.session_state.current_index = 0 - if 'current_query' not in st.session_state: st.session_state.current_query = '' @@ -54,6 +49,9 @@ if 'prev_button' not in st.session_state: if 'update_component' not in st.session_state: st.session_state.update_component = 0 +if 'offset' not in st.session_state: + st.session_state.offset = 0 + def scroll_into_view(): js = '''