Spaces:
Runtime error
Runtime error
Upload 25_Deals.py
Browse files- pages/25_Deals.py +36 -0
pages/25_Deals.py
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
import streamlit as st
|
3 |
+
import yfinance as yf
|
4 |
+
import streamlit.components.v1 as components
|
5 |
+
from requests_html import HTMLSession
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
st.set_page_config('Home',":shark:","wide",menu_items={'About': "This is an *extremely* cool app!"})
|
10 |
+
|
11 |
+
|
12 |
+
menu=['Game']
|
13 |
+
ch=st.sidebar.selectbox('Menu',menu)
|
14 |
+
|
15 |
+
if ch == 'Game':
|
16 |
+
st.title('Good deals from stores below:')
|
17 |
+
url = requests.get('https://www.cheapshark.com/api/1.0/stores')
|
18 |
+
x = url.json()
|
19 |
+
|
20 |
+
|
21 |
+
with st.container():
|
22 |
+
for i in x:
|
23 |
+
st.write(i['storeName'] )
|
24 |
+
st.write('---')
|
25 |
+
|
26 |
+
url2 = requests.get('https://www.cheapshark.com/api/1.0/deals?storeID=1&upperPrice=15')
|
27 |
+
y = url2.json()
|
28 |
+
|
29 |
+
for j in y:
|
30 |
+
with st.container():
|
31 |
+
st.write('Game name: '+j['title'])
|
32 |
+
st.write('ID: '+j['gameID'])
|
33 |
+
st.write('New price: '+j['salePrice'])
|
34 |
+
st.write('Old price: '+j['normalPrice'])
|
35 |
+
st.write(j['thumb'])
|
36 |
+
st.write('---')
|