Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,8 @@ import requests
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
|
|
|
|
6 |
traderater = "https://www.fantasylife.com/api/projections/v1/nfl/ratemytrade/season/update"
|
7 |
|
8 |
dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/dwain/season/update"
|
@@ -21,7 +23,7 @@ headers = {
|
|
21 |
'Authorization': 'Bearer 6984da1f-2c81-4140-8206-d018af38533f',
|
22 |
}
|
23 |
|
24 |
-
tab1, tab2, tab3, tab4 = st.tabs(['Season Long (Live Site)', 'Season Long (Dev Site)', 'Weekly', 'Trade Rater'])
|
25 |
|
26 |
with tab1:
|
27 |
with st.container():
|
@@ -100,5 +102,16 @@ with tab4:
|
|
100 |
st.info("Update FantasyLife Trade Rater")
|
101 |
if st.button("Projection Update (Trade Rater)", key='reset10'):
|
102 |
response = requests.post(traderater, headers=headers)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
if response.status_code == 200:
|
104 |
st.write("Uploading!")
|
|
|
3 |
|
4 |
st.set_page_config(layout="wide")
|
5 |
|
6 |
+
purge_cache = "https://sheetdb.io/api/v1/svino07zkd6j6/cache/purge/f8fc41b2"
|
7 |
+
|
8 |
traderater = "https://www.fantasylife.com/api/projections/v1/nfl/ratemytrade/season/update"
|
9 |
|
10 |
dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/dwain/season/update"
|
|
|
23 |
'Authorization': 'Bearer 6984da1f-2c81-4140-8206-d018af38533f',
|
24 |
}
|
25 |
|
26 |
+
tab1, tab2, tab3, tab4, tab5 = st.tabs(['Season Long (Live Site)', 'Season Long (Dev Site)', 'Weekly', 'Trade Rater', 'Purge FL API Hub Cache'])
|
27 |
|
28 |
with tab1:
|
29 |
with st.container():
|
|
|
102 |
st.info("Update FantasyLife Trade Rater")
|
103 |
if st.button("Projection Update (Trade Rater)", key='reset10'):
|
104 |
response = requests.post(traderater, headers=headers)
|
105 |
+
if response.status_code == 200:
|
106 |
+
st.write("Uploading!")
|
107 |
+
|
108 |
+
with tab5:
|
109 |
+
with st.container():
|
110 |
+
col1, col2, col3 = st.columns([3, 3, 3])
|
111 |
+
|
112 |
+
with col1:
|
113 |
+
st.info("Reset the API cache for the site")
|
114 |
+
if st.button("Reset Cache", key='reset11'):
|
115 |
+
response = requests.post(purge_cache, headers=headers)
|
116 |
if response.status_code == 200:
|
117 |
st.write("Uploading!")
|