File size: 840 Bytes
cba785c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import requests

import streamlit as st


Menu=['Home','News','Report']
choise=st.sidebar.selectbox('Menu',Menu)
if choise=='Home' :
    st.title('Welcome to Home Page')

elif choise=='News' :
    st.title('Welcome to News page')
    tt = st.text_input('اخبار کدام تیم را دنبال می کنید؟')
    st.markdown('<style>.block-container {direction : rtl}</style>',
                unsafe_allow_html=True)
    r = requests.get(f'https://search-api.varzesh3.com/v1.0/query?q={tt}')
    x = r.json()
    st.title('اخبار ورزشی')
    for i in x['news']:
        st.subheader(i['title'])
        st.success(i['publishedOn'])
        st.write(i['shortDescription'])
        st.warning(i['viewCount'])
        st.image(i['picture'])
        st.write('---------------------')
else :
    st.title('Welcom to Report page')