add cache_data
authorClaromes <claromes@hey.com>
Thu, 1 Jun 2023 15:39:30 +0000 (12:39 -0300)
committerClaromes <claromes@hey.com>
Thu, 1 Jun 2023 15:39:30 +0000 (12:39 -0300)
app.py

diff --git a/app.py b/app.py
index 7bd1c059b0cfa3b3dfd5392d8df7c1504427d1e6..6b201431ca7f89d69d508c7b60a00133729526fb 100644 (file)
--- 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 = []