Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import requests
|
3 |
+
|
4 |
+
st.set_page_config(layout="wide")
|
5 |
+
|
6 |
+
dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/dwain/season/update"
|
7 |
+
freedman_url = "https://www.fantasylife.com/api/projections/v1/nfl/freedman/season/update"
|
8 |
+
agg_url = "https://www.fantasylife.com/api/projections/v1/nfl/aggregate/season/update"
|
9 |
+
|
10 |
+
weekly_dwain_url = "https://www.fantasylife.com/api/projections/v1/nfl/james/game/update"
|
11 |
+
weekly_freedman_url = "https://www.fantasylife.com/api/projections/v1/nfl/freedman/game/update"
|
12 |
+
weekly_agg_url = "https://www.fantasylife.com/api/projections/v1/nfl/aggregate/game/update"
|
13 |
+
|
14 |
+
headers = {
|
15 |
+
'Authorization': 'Bearer 6984da1f-2c81-4140-8206-d018af38533f',
|
16 |
+
}
|
17 |
+
|
18 |
+
with st.container():
|
19 |
+
col1, col2, col3 = st.columns([3, 3, 3])
|
20 |
+
|
21 |
+
with col1:
|
22 |
+
st.info("Update Dwain's FantasyLife Season Long Projections")
|
23 |
+
if st.button("Dwain Projection Update (Seasonal)", key='reset1'):
|
24 |
+
response = requests.post(dwain_url, headers=headers)
|
25 |
+
if response.status_code == 200:
|
26 |
+
st.write("Uploading!")
|
27 |
+
with col2:
|
28 |
+
st.info("Update Freedman's FantasyLife Season Long Projections")
|
29 |
+
if st.button("Freedman Projection Update (Seasonal)", key='reset2'):
|
30 |
+
response = requests.post(freedman_url, headers=headers)
|
31 |
+
if response.status_code == 200:
|
32 |
+
st.write("Uploading!")
|
33 |
+
with col3:
|
34 |
+
st.info("Update the Aggregate FantasyLife Season Long Projections")
|
35 |
+
if st.button("Aggregate Projection Update (Seasonal)", key='reset3'):
|
36 |
+
response = requests.post(agg_url, headers=headers)
|
37 |
+
if response.status_code == 200:
|
38 |
+
st.write("Uploading!")
|
39 |
+
|
40 |
+
with st.container():
|
41 |
+
col1, col2, col3 = st.columns([3, 3, 3])
|
42 |
+
|
43 |
+
with col1:
|
44 |
+
st.info("Update Dwain's FantasyLife Season Long Projections")
|
45 |
+
if st.button("Dwain Projection Update (Weekly)", key='reset4'):
|
46 |
+
response = requests.post(weekly_dwain_url, headers=headers)
|
47 |
+
if response.status_code == 200:
|
48 |
+
st.write("Uploading!")
|
49 |
+
with col2:
|
50 |
+
st.info("Update Freedman's FantasyLife Season Long Projections")
|
51 |
+
if st.button("Freedman Projection Update (Weekly)", key='reset5'):
|
52 |
+
response = requests.post(weekly_freedman_url, headers=headers)
|
53 |
+
if response.status_code == 200:
|
54 |
+
st.write("Uploading!")
|
55 |
+
with col3:
|
56 |
+
st.info("Update the Aggregate FantasyLife Season Long Projections")
|
57 |
+
if st.button("Aggregate Projection Update (Weekly)", key='reset6'):
|
58 |
+
response = requests.post(weekly_agg_url, headers=headers)
|
59 |
+
if response.status_code == 200:
|
60 |
+
st.write("Uploading!")
|