Skip to content

Commit

Permalink
update code, add warc warning, update iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
claromes committed Aug 16, 2023
1 parent f0d73a2 commit e156a5e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import json
import re

__version__ = '0.2'

year = datetime.datetime.now().year

st.set_page_config(
Expand Down Expand Up @@ -228,11 +226,12 @@ def attr(i):
bar.progress(0)
progress = st.empty()
links = query_api(handle, tweets_per_page, st.session_state.offset)
parsed_links = parse_links(links)[0]
tweet_links = parse_links(links)[1]
mimetype = parse_links(links)[2]
timestamp = parse_links(links)[3]

parse = parse_links(links)
parsed_links = parse[0]
tweet_links = parse[1]
mimetype = parse[2]
timestamp = parse[3]

if links:
st.divider()
Expand Down Expand Up @@ -277,9 +276,12 @@ def display_not_tweet():
st.divider()
if mimetype[i] == 'text/html':
st.error('Tweet has been deleted.')
components.iframe(link, height=500, scrolling=True)

st.divider()

# components.iframe(link, height=500, width=700)
st.markdown('<iframe src="{}" loading="lazy" height=500 width="100%"></iframe>'.format(link), unsafe_allow_html=True)
if mimetype[i] == 'warc/revisit':
st.warning('''MIME Type was not parsed.''')

st.divider()

Expand Down Expand Up @@ -328,6 +330,7 @@ def display_not_tweet():
st.session_state.next_disabled = True
else:
st.session_state.next_disabled = False
# TODO
except IndexError:
if start_index <= 0:
st.session_state.prev_disabled = True
Expand Down

0 comments on commit e156a5e

Please sign in to comment.