File size: 1,427 Bytes
bee1702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st

# Function to parse the text file
def parse_data(filename):
    with open(filename, "r") as file:
        lines = file.readlines()

    categories = {}
    current_category = None

    for line in lines:
        line = line.strip()
        if not line:
            continue
        if line.startswith('Best'):
            current_category = line
            categories[current_category] = []
        else:
            categories[current_category].append(line)

    return categories

# Function to create a search URL
def create_search_url(artist_song):
    base_url = "https://www.wikipedia.org/search-redirect.php?family=wikipedia&language=en&search="
    return base_url + artist_song.replace(' ', '+').replace('–', '%E2%80%93')

# Parsing the data
data = parse_data("requiredData.txt")

# Streamlit page configuration
st.set_page_config(page_title="MTV VMAs 2023 Awards", layout="wide")

# Main title
st.title("πŸ† Video Awards Presentation Streamlit for 2023!")

# Displaying data
for category, nominees in data.items():
    st.header(f"{category} 🎢")
    with st.expander("View Nominees"):
        for nominee in nominees:
            col1, col2 = st.columns([3, 1])
            with col1:
                st.markdown(f"* {nominee}")
            with col2:
                st.markdown(f"[Wikipedia]({create_search_url(nominee)})")

# Footer
st.caption("Source: MTV Video Music Awards 2023")