Spaces:
Running
Running
File size: 6,248 Bytes
b81ce47 463a75b f8324a1 b81ce47 7873711 8ae9d48 b81ce47 463a75b 8ae9d48 f8324a1 e6d6387 f8324a1 e6d6387 f8324a1 8ae9d48 f8324a1 e6d6387 f8324a1 e6d6387 f8324a1 8ae9d48 f8324a1 e6d6387 f8324a1 e6d6387 f8324a1 b81ce47 f8324a1 463a75b f8324a1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
import streamlit as st
import requests
st.set_page_config(layout="wide")
purge_cache = "https://sheetdb.io/api/v1/svino07zkd6j6/cache/purge/f8fc41b2"
traderater = "https://www.fantasylife.com/api/projections/v1/nfl/ratemytrade/season/update"
dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/dwain/season/update"
freedman_url = "https://www.fantasylife.com/api/projections/v1/nfl/freedman/season/update"
agg_url = "https://www.fantasylife.com/api/projections/v1/nfl/aggregate/season/update"
weekly_dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/james/game/update"
weekly_freedman_url = "https://www.fantasylife.com/api/projections/v1/nfl/freedman/game/update"
weekly_agg_url = "https://www.fantasylife.com/api/projections/v1/nfl/aggregate/game/update"
dev_dwain_url = "https://fantasylife.dev.spotlightsportsb2b.com/api/projections/v1/nfl/dwain/season/update"
dev_freedman_url = "https://fantasylife.dev.spotlightsportsb2b.com/api/projections/v1/nfl/freedman/season/update"
dev_agg_url = "https://fantasylife.dev.spotlightsportsb2b.com/api/projections/v1/nfl/aggregate/season/update"
headers = {
'Authorization': 'Bearer 6984da1f-2c81-4140-8206-d018af38533f',
}
tab1, tab2, tab3, tab4, tab5 = st.tabs(['Season Long (Live Site)', 'Season Long (Dev Site)', 'Weekly', 'Trade Rater', 'Purge FL API Hub Cache'])
with tab1:
with st.container():
col1, col2, col3 = st.columns([3, 3, 3])
with col1:
st.info("Update Dwain's LIVE SITE FantasyLife Season Long Projections")
if st.button("Dwain Projection Update (Live Seasonal)", key='reset1'):
response = requests.post(dwain_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Proj_Season")
if response.status_code == 200:
st.write("Uploading!")
with col2:
st.info("Update Freedman's LIVE SITE FantasyLife Season Long Projections")
if st.button("Freedman Projection Update (Live Seasonal)", key='reset2'):
response = requests.post(freedman_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Freedman")
if response.status_code == 200:
st.write("Uploading!")
with col3:
st.info("Update the Aggregate LIVE SITE FantasyLife Season Long Projections")
if st.button("Aggregate Projection Update (Live Seasonal)", key='reset3'):
response = requests.post(agg_url, headers=headers)
if response.status_code == 200:
st.write("Uploading!")
with tab2:
with st.container():
col1, col2, col3 = st.columns([3, 3, 3])
with col1:
st.info("Update Dwain's DEV SITE FantasyLife Season Long Projections")
if st.button("Dwain Projection Update (Dev Seasonal)", key='reset4'):
response = requests.post(dev_dwain_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Proj_Season")
if response.status_code == 200:
st.write("Uploading!")
with col2:
st.info("Update Freedman's DEV SITE FantasyLife Season Long Projections")
if st.button("Freedman Projection Update (Dev Seasonal)", key='reset5'):
response = requests.post(dev_freedman_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Freedman")
if response.status_code == 200:
st.write("Uploading!")
with col3:
st.info("Update the Aggregate DEV SITE FantasyLife Season Long Projections")
if st.button("Aggregate Projection Update (Dev Seasonal)", key='reset6'):
response = requests.post(dev_agg_url, headers=headers)
if response.status_code == 200:
st.write("Uploading!")
with tab3:
with st.container():
col1, col2, col3 = st.columns([3, 3, 3])
with col1:
st.info("Update Dwain's FantasyLife Weekly Projections")
if st.button("Dwain Projection Update (Weekly)", key='reset7'):
response = requests.post(weekly_dwain_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Proj_Season")
if response.status_code == 200:
st.write("Uploading!")
with col2:
st.info("Update Freedman's FantasyLife Weekly Projections")
if st.button("Freedman Projection Update (Weekly)", key='reset8'):
response = requests.post(weekly_freedman_url, headers=headers)
clear = requests.get("https://sheetdb.io/api/v1/svino07zkd6j6?sheet=2024_NFL_Freedman")
if response.status_code == 200:
st.write("Uploading!")
with col3:
st.info("Update the Aggregate FantasyLife Weekly Projections")
if st.button("Aggregate Projection Update (Weekly)", key='reset9'):
response = requests.post(weekly_agg_url, headers=headers)
if response.status_code == 200:
st.write("Uploading!")
with tab4:
with st.container():
col1, col2, col3 = st.columns([3, 3, 3])
with col1:
st.info("Update FantasyLife Trade Rater")
if st.button("Projection Update (Trade Rater)", key='reset10'):
response = requests.post(traderater, headers=headers)
if response.status_code == 200:
st.write("Uploading!")
with tab5:
with st.container():
col1, col2, col3 = st.columns([3, 3, 3])
with col1:
st.info("Reset the API cache for the site")
if st.button("Reset Cache", key='reset11'):
response = requests.post(purge_cache, headers=headers)
if response.status_code == 200:
st.write("Uploading!") |