File size: 1,818 Bytes
ff656b4
a4e59bc
 
 
3140df4
ff656b4
3140df4
 
 
8e20c92
 
 
 
 
 
 
 
 
 
 
 
 
82be1ff
27ddd2d
ff656b4
 
 
 
5872f21
ff656b4
5872f21
 
ff656b4
82be1ff
3140df4
 
 
 
 
 
82be1ff
a4e59bc
82be1ff
5872f21
82be1ff
6a2830d
5872f21
 
b380166
aa3f1a9
 
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
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"])