Spaces:
Runtime error
Runtime error
Upload 10_Sport.py
Browse files- pages/10_Sport.py +30 -0
pages/10_Sport.py
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
10 |
+
|
11 |
+
st.set_page_config('Sport',":soccer:","wide",menu_items={'About': "This is an *extremely* cool app!"})
|
12 |
+
|
13 |
+
|
14 |
+
menu=['From varzesh3.ir']
|
15 |
+
ch=st.sidebar.selectbox('Menu',menu)
|
16 |
+
|
17 |
+
|
18 |
+
if 'From varzesh3.ir' in ch:
|
19 |
+
st.title('Sport news')
|
20 |
+
ti=st.text_input('Search')
|
21 |
+
if len(ti)>0:
|
22 |
+
r=requests.get('https://search-api.varzesh3.com/v1.0/query?q='+ti)
|
23 |
+
x=r.json()
|
24 |
+
for i in x['news']:
|
25 |
+
with st.container():
|
26 |
+
st.success(i['publishedOn'])
|
27 |
+
st.subheader(i['title'])
|
28 |
+
st.write(i['shortDescription'])
|
29 |
+
st.image(i['picture'])
|
30 |
+
st.write('---')
|