Spaces:
Sleeping
Sleeping
Update influencer_ui.py
Browse filesintegrating response from API key
- influencer_ui.py +16 -14
influencer_ui.py
CHANGED
|
@@ -7,19 +7,19 @@ import json
|
|
| 7 |
|
| 8 |
profile_default_image_url = "https://t4.ftcdn.net/jpg/03/46/93/61/360_F_346936114_RaxE6OQogebgAWTalE1myseY1Hbb5qPM.jpg"
|
| 9 |
insta_rag_url = "https://us-central1-steam-cache-277314.cloudfunctions.net/gemini-hackathon-insta-influencer"
|
| 10 |
-
influencers_data = {
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
}
|
| 23 |
|
| 24 |
|
| 25 |
def show_influencer_search_page():
|
|
@@ -37,7 +37,9 @@ def show_influencer_search_page():
|
|
| 37 |
resp = requests.post(insta_rag_url, json=data)
|
| 38 |
response_dict = json.loads(resp.text)
|
| 39 |
st.write(response_dict)
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
# Display influencer images as clickable buttons
|
| 42 |
for influencer_id, influencer_info in influencers_data.items():
|
| 43 |
col1, col2 = st.columns([1, 3])
|
|
|
|
| 7 |
|
| 8 |
profile_default_image_url = "https://t4.ftcdn.net/jpg/03/46/93/61/360_F_346936114_RaxE6OQogebgAWTalE1myseY1Hbb5qPM.jpg"
|
| 9 |
insta_rag_url = "https://us-central1-steam-cache-277314.cloudfunctions.net/gemini-hackathon-insta-influencer"
|
| 10 |
+
# influencers_data = {
|
| 11 |
+
# "influencer1": {
|
| 12 |
+
# "name": "Influencer One",
|
| 13 |
+
# "image": "./images/inf1.png", # Replace with actual image paths
|
| 14 |
+
# "details": "Details about Influencer One..."
|
| 15 |
+
# },
|
| 16 |
+
# "influencer2": {
|
| 17 |
+
# "name": "Influencer Two",
|
| 18 |
+
# "image": "./images/inf2.png",
|
| 19 |
+
# "details": "Details about Influencer Two..."
|
| 20 |
+
# }
|
| 21 |
+
# # Add more influencers as needed
|
| 22 |
+
# }
|
| 23 |
|
| 24 |
|
| 25 |
def show_influencer_search_page():
|
|
|
|
| 37 |
resp = requests.post(insta_rag_url, json=data)
|
| 38 |
response_dict = json.loads(resp.text)
|
| 39 |
st.write(response_dict)
|
| 40 |
+
influencers_data = {response_dict.get('handle'): {"name": response_dict.get('handle', ''),
|
| 41 |
+
"image": response_dict.get('profile_image_url', profile_default_image_url),
|
| 42 |
+
"details": response_dict.get('bio', '')}}
|
| 43 |
# Display influencer images as clickable buttons
|
| 44 |
for influencer_id, influencer_info in influencers_data.items():
|
| 45 |
col1, col2 = st.columns([1, 3])
|