Spaces:
Sleeping
Sleeping
Update influencer_ui.py
Browse files- influencer_ui.py +15 -14
influencer_ui.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
influencers_data = {
|
| 4 |
"influencer1": {
|
|
@@ -14,11 +17,6 @@ influencers_data = {
|
|
| 14 |
# Add more influencers as needed
|
| 15 |
}
|
| 16 |
|
| 17 |
-
def load_influencer_data():
|
| 18 |
-
# This function would load influencer data from a JSON file
|
| 19 |
-
# For this example, we are using a dummy dictionary
|
| 20 |
-
return influencers_data
|
| 21 |
-
|
| 22 |
|
| 23 |
def show_influencer_search_page():
|
| 24 |
st.header("Influencer Search and Analysis")
|
|
@@ -47,19 +45,22 @@ def show_influencer_search_page():
|
|
| 47 |
search_button = st.button("Search")
|
| 48 |
|
| 49 |
if search_button:
|
| 50 |
-
# Load influencer data (from JSON or dictionary)
|
| 51 |
-
data = load_influencer_data()
|
| 52 |
|
| 53 |
# Display influencer images as clickable buttons
|
| 54 |
-
for influencer_id, influencer_info in
|
| 55 |
col1, col2 = st.columns([1, 3])
|
|
|
|
| 56 |
with col1:
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
|
| 65 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from PIL import Image
|
| 3 |
+
import requests
|
| 4 |
+
from io import BytesIO
|
| 5 |
|
| 6 |
influencers_data = {
|
| 7 |
"influencer1": {
|
|
|
|
| 17 |
# Add more influencers as needed
|
| 18 |
}
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
def show_influencer_search_page():
|
| 22 |
st.header("Influencer Search and Analysis")
|
|
|
|
| 45 |
search_button = st.button("Search")
|
| 46 |
|
| 47 |
if search_button:
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# Display influencer images as clickable buttons
|
| 50 |
+
for influencer_id, influencer_info in influencers_data.items():
|
| 51 |
col1, col2 = st.columns([1, 3])
|
| 52 |
+
|
| 53 |
with col1:
|
| 54 |
+
# Display the influencer image
|
| 55 |
+
st.image(influencer_info["image"], width=100)
|
| 56 |
+
|
| 57 |
+
with col2:
|
| 58 |
+
# Create a button with the influencer's name
|
| 59 |
+
if st.button(influencer_info["name"], key=influencer_id):
|
| 60 |
+
# Display details when the button (name) is clicked
|
| 61 |
+
st.subheader(influencer_info["name"])
|
| 62 |
+
st.write(influencer_info["details"])
|
| 63 |
+
|
| 64 |
|
| 65 |
|
| 66 |
|