Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from PIL import Image | |
| import requests | |
| from io import BytesIO | |
| import json | |
| profile_default_image_url = "https://t4.ftcdn.net/jpg/03/46/93/61/360_F_346936114_RaxE6OQogebgAWTalE1myseY1Hbb5qPM.jpg" | |
| insta_rag_url = "https://us-central1-steam-cache-277314.cloudfunctions.net/gemini-hackathon-insta-influencer" | |
| influencers_data = { | |
| "influencer1": { | |
| "name": "Influencer One", | |
| "image": "./images/inf1.png", # Replace with actual image paths | |
| "details": "Details about Influencer One..." | |
| }, | |
| "influencer2": { | |
| "name": "Influencer Two", | |
| "image": "./images/inf2.png", | |
| "details": "Details about Influencer Two..." | |
| } | |
| # Add more influencers as needed | |
| } | |
| def show_influencer_search_page(): | |
| st.header("Influencer Search and Analysis") | |
| st.markdown("Discover influencers by name, niche, location, follower count, and more.") | |
| search_query = st.text_input("Search Influencers", "") | |
| # Influencer search button (assuming this is part of your UI) | |
| search_button = st.button("Search Influencers") | |
| if search_button: | |
| st.write(search_query) | |
| data = {"search_query": search_query} | |
| resp = requests.post(insta_rag_url, json=data) | |
| response_dict = json.loads(resp.text) | |
| st.write(response_dict) | |
| # Display influencer images as clickable buttons | |
| for influencer_id, influencer_info in influencers_data.items(): | |
| col1, col2 = st.columns([1, 3]) | |
| with col1: | |
| st.image(influencer_info["image"], width=50) | |
| with col2: | |
| with st.expander("Influencer Details"): | |
| st.subheader(influencer_info["name"]) | |
| st.write(influencer_info["details"]) |