update style
authorClaromes <claromes@hey.com>
Fri, 21 Jul 2023 05:52:09 +0000 (02:52 -0300)
committerClaromes <claromes@hey.com>
Fri, 21 Jul 2023 05:52:09 +0000 (02:52 -0300)
README.md
app.py

index 63b6f3c003b13a399280c1def1558694d7512225..21b4bbd6a47d74906f56e7e400b74c5f16143e52 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,7 +2,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)
 
-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).
+Web tool that displays multiple archived tweets on Wayback Machine to avoid opening each link manually. Via [Wayback CDX Server API](https://github.com/internetarchive/wayback/tree/master/wayback-cdx-server).
 
 [waybacktweets.streamlit.app](https://waybacktweets.streamlit.app/)
 
@@ -10,8 +10,8 @@ Tool that displays multiple archived tweets on Wayback Machine to avoid opening
 
 ## Features
 
-- 50 embed tweets per page
-- Filter by only deleted tweets
+- 25 embedded tweets per page
+- Filtering by only deleted tweets
 - Wayback Machine link and original tweet link
 - Datetime information
 
@@ -47,7 +47,7 @@ Streamlit will be served at http://localhost:8501
     - [x] Disabled/ Empty
 - [x] Feedbacks
 - [ ] Download dataset
-- [ ] Review data cache
+- [x] Review data cache
 - [ ] Range size defined by user
 - [ ] Prevent duplicate URLs
 - [ ] Hide Twitter header banner (iframe)
diff --git a/app.py b/app.py
index 9ec67415f9adb7e3cc23c107622a3209f4ce05af..73df67d41ff81d04d3031cde00708d71e0fb0d30 100644 (file)
--- a/app.py
+++ b/app.py
@@ -28,6 +28,17 @@ st.set_page_config(
     }
 )
 
+# https://discuss.streamlit.io/t/remove-hide-running-man-animation-on-top-of-page/21773/3
+hide_streamlit_style = '''
+<style>
+    header[data-testid="stHeader"] {
+        opacity: 0.5;
+    }
+</style>
+'''
+
+st.markdown(hide_streamlit_style, unsafe_allow_html=True)
+
 if 'current_query' not in st.session_state:
     st.session_state.current_query = ''
 
@@ -118,7 +129,7 @@ def parse_links(links):
 
 def attr(i):
     st.markdown('''
-    {}. **Wayback Machine:** [link]({}) | **MIME Type:** {} | **From:** {} | **Tweet:** [link]({})
+    {}. **Wayback Machine:** [link]({}) | **MIME Type:** {} | **Created at:** {} | **Tweet:** [link]({})
     '''.format(i + st.session_state.offset, link, mimetype[i], datetime.datetime.strptime(timestamp[i], "%Y%m%d%H%M%S"), tweet_links[i]))
 
 # UI
@@ -142,9 +153,8 @@ if query or handle:
         st.session_state.offset = 0
 
     count = tweets_count(handle)
-    print(count)
 
-    st.write('**@{} has {} tweets captured**'.format(handle, count))
+    st.write('**{} URLs have been captured**'.format(count))
 
     tweets_per_page = 25
 
@@ -185,7 +195,7 @@ if query or handle:
                 start_index = st.session_state.offset
                 end_index = min(count, start_index + tweets_per_page)
 
-                for i in range(tweets_per_page):
+                for i in range(tweets_per_page): #fix range
                     link = parsed_links[i]
                     tweet = embed(tweet_links[i])