Spaces:
Sleeping
Sleeping
Update influencer_onboarding.py
Browse filesadded API call to onboard single influencer
- influencer_onboarding.py +9 -4
influencer_onboarding.py
CHANGED
|
@@ -21,6 +21,15 @@ influencers_data = {
|
|
| 21 |
# Add more influencers as needed
|
| 22 |
}
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
def show_onboarding_page():
|
| 25 |
st.title("Onboard Influencers")
|
| 26 |
|
|
@@ -48,10 +57,6 @@ def onboard_influencers_from_file(file):
|
|
| 48 |
# Logic to read and process file to onboard influencers
|
| 49 |
pass # Replace with actual implementation
|
| 50 |
|
| 51 |
-
def onboard_single_influencer(handle):
|
| 52 |
-
# Logic to onboard a single influencer
|
| 53 |
-
pass # Replace with actual implementation
|
| 54 |
-
|
| 55 |
def display_onboarded_influencers():
|
| 56 |
# Display the list of onboarded influencers
|
| 57 |
st.write("List of Onboarded Influencers...")
|
|
|
|
| 21 |
# Add more influencers as needed
|
| 22 |
}
|
| 23 |
|
| 24 |
+
def onboard_single_influencer(handle):
|
| 25 |
+
url = "https://us-central1-steam-cache-277314.cloudfunctions.net/create_insta_task"
|
| 26 |
+
data = {"handle": handle}
|
| 27 |
+
response = requests.post(url, json=data)
|
| 28 |
+
if response["status_code"] == 200:
|
| 29 |
+
st.write("Onboarding influencer! Please wait...")
|
| 30 |
+
else:
|
| 31 |
+
st.write(response["data"]["error"])
|
| 32 |
+
|
| 33 |
def show_onboarding_page():
|
| 34 |
st.title("Onboard Influencers")
|
| 35 |
|
|
|
|
| 57 |
# Logic to read and process file to onboard influencers
|
| 58 |
pass # Replace with actual implementation
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
def display_onboarded_influencers():
|
| 61 |
# Display the list of onboarded influencers
|
| 62 |
st.write("List of Onboarded Influencers...")
|