Spaces:
Runtime error
Runtime error
File size: 2,649 Bytes
bee1702 a5c4320 bee1702 a2f35de a5c4320 a2f35de 55d55fb 1a4ce2b 55d55fb 1a4ce2b 30e0372 bee1702 497d573 bee1702 a5c4320 bee1702 1a4ce2b bee1702 1a4ce2b bee1702 b4aaf21 a5c4320 b4aaf21 1a4ce2b b4aaf21 1a4ce2b b4aaf21 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
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 for Wikipedia:
def create_search_url_wikipedia(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').replace('&', 'and')
# Function to create a search URL for YouTube:
def create_search_url_youtube(artist_song):
base_url = "https://www.youtube.com/results?search_query="
return base_url + artist_song.replace(' ', '+').replace('–', '%E2%80%93').replace('&', 'and')
# Function to create a search URL for Chords:
def create_search_url_chords(artist_song):
base_url = "https://www.ultimate-guitar.com/search.php?search_type=title&value="
return base_url + artist_song.replace(' ', '+').replace('–', '%E2%80%93').replace('&', 'and')
# Function to create a search URL for Lyrics:
def create_search_url_lyrics(artist_song):
base_url = "https://www.google.com/search?q="
return base_url + artist_song.replace(' ', '+').replace('–', '%E2%80%93').replace('&', 'and') + '+lyrics'
# Parsing the data
data = parse_data("data.txt")
# Streamlit page configuration
st.set_page_config(page_title="MTV VMAs - 2023 Awards Wikipedia and Youtube", layout="wide")
# Main title
st.title("🏆 Video Awards 2023 - Wikipedia, Youtube, Chords, Lyrics")
# Displaying data
for category, nominees in data.items():
st.header(f"{category} 🎶")
with st.expander("View Nominees"):
for nominee in nominees:
col1, col2, col3, col4, col5 = st.columns([4, 1, 1, 1, 1])
with col1:
st.markdown(f"* {nominee}")
with col2:
st.markdown(f"[📚Wikipedia]({create_search_url_wikipedia(nominee)})")
with col3:
st.markdown(f"[🎥YouTube]({create_search_url_youtube(nominee)})")
with col4:
st.markdown(f"[🎸Chords]({create_search_url_chords(nominee)})")
with col5:
st.markdown(f"[🎶Lyrics]({create_search_url_lyrics(nominee)})")
# Footer
st.caption("Source: MTV Video Music Awards 2023")
|