Spaces:
Sleeping
Sleeping
Delete pages/Content2Lead.py
Browse files- pages/Content2Lead.py +0 -85
pages/Content2Lead.py
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
import streamlit as st
|
2 |
-
import requests
|
3 |
-
import os
|
4 |
-
|
5 |
-
endpoint=os.getenv('blog_lead_endpoint')
|
6 |
-
def main():
|
7 |
-
st.title("Content2Lead Matcher")
|
8 |
-
email_options = [
|
9 |
-
"[email protected]",
|
10 |
-
"[email protected]",
|
11 |
-
"[email protected]",
|
12 |
-
"[email protected]",
|
13 |
-
"[email protected]",
|
14 |
-
"[email protected]",
|
15 |
-
"[email protected]",
|
16 |
-
"[email protected]",
|
17 |
-
"[email protected]",
|
18 |
-
"[email protected]",
|
19 |
-
"[email protected]",
|
20 | |
21 |
-
]
|
22 |
-
|
23 |
-
account_stages = [
|
24 |
-
"Pre-Sales",
|
25 |
-
"Pre-Sales (Unresponsive, After Call)",
|
26 |
-
"Pre-Sales (Long-Term/ Cold)",
|
27 |
-
"Sales Opportunity",
|
28 |
-
"Closed Lost (Opportunity)",
|
29 |
-
"Current Client",
|
30 |
-
"Pre-Sales (Short-Term/ Hot)",
|
31 |
-
"Pre-Sales (Mid-Term/ Warm)",
|
32 |
-
"Project Cancelled"
|
33 |
-
]
|
34 |
-
|
35 |
-
# Creating a form
|
36 |
-
with st.form(key='blog2lead_form'):
|
37 |
-
blog_urls = st.text_area("Enter the Content URLs (one per line)", "")
|
38 |
-
email_address = st.selectbox("Select your email address", email_options)
|
39 |
-
selected_stages = st.multiselect("Select Account Stages (optional)", account_stages)
|
40 |
-
submit_button = st.form_submit_button(label='Submit')
|
41 |
-
|
42 |
-
if submit_button:
|
43 |
-
urls = blog_urls.strip().split('\n')
|
44 |
-
if urls and email_address:
|
45 |
-
# Define your data payload to send
|
46 |
-
data_to_send = {
|
47 |
-
"urls": urls,
|
48 |
-
"email_receiver": email_address,
|
49 |
-
}
|
50 |
-
|
51 |
-
# Add the filter to the payload only if selected_stages is not empty
|
52 |
-
if selected_stages:
|
53 |
-
data_to_send["filter"] = {
|
54 |
-
"Account Stage": {"$in": selected_stages}
|
55 |
-
}
|
56 |
-
|
57 |
-
# Sending the POST request to FastAPI
|
58 |
-
response = requests.post(endpoint, json=data_to_send)
|
59 |
-
|
60 |
-
# Handling the response
|
61 |
-
if response.status_code == 200:
|
62 |
-
st.info("Your request has been processed successfully.")
|
63 |
-
else:
|
64 |
-
st.error("Data transmission failed. Please try again later.")
|
65 |
-
else:
|
66 |
-
st.error("Please fill out all fields.")
|
67 |
-
|
68 |
-
if __name__ == "__main__":
|
69 |
-
logo_url = "https://i.imgur.com/WYnv26e.jpeg" # Replace this with your image's direct URL
|
70 |
-
st.markdown(
|
71 |
-
f"""
|
72 |
-
<style>
|
73 |
-
.logo {{
|
74 |
-
position: fixed;
|
75 |
-
bottom: 5px;
|
76 |
-
right: 5px;
|
77 |
-
width: 100px; # Adjust width as needed
|
78 |
-
}}
|
79 |
-
</style>
|
80 |
-
<img src="{logo_url}" class="logo">
|
81 |
-
""",
|
82 |
-
unsafe_allow_html=True,
|
83 |
-
)
|
84 |
-
|
85 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|