From dcda98f541f2bdc8926937d2258e7c29352f2d95 Mon Sep 17 00:00:00 2001 From: Claromes Date: Thu, 1 Jun 2023 12:39:30 -0300 Subject: [PATCH] add cache_data --- app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app.py b/app.py index 7bd1c05..6b20143 100644 --- a/app.py +++ b/app.py @@ -80,6 +80,7 @@ def scroll_into_view(): components.html(js, width=0, height=0) +@st.cache_data(ttl=3600, show_spinner=False) def embed(tweet): api = 'https://publish.twitter.com/oembed?url={}'.format(tweet) response = requests.get(api) @@ -89,6 +90,7 @@ def embed(tweet): else: return None +@st.cache_data(ttl=3600, show_spinner=False) def query_api(handle): if not handle: st.warning('username, please!') @@ -101,6 +103,7 @@ def query_api(handle): else: return None +@st.cache_data(ttl=3600, show_spinner=False) def parse_links(links): parsed_links = [] timestamp = [] -- 2.34.1