File size: 1,846 Bytes
30f26dc
 
 
 
3b4e5eb
30f26dc
 
 
 
 
 
 
 
 
6456dca
1af1886
 
30f26dc
 
3b4e5eb
30f26dc
 
 
 
 
 
 
 
 
 
 
c575aba
30f26dc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st
import requests
import os
def main():
    st.title("Content2Lead Matcher")
    email_options = [
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]",
    "[email protected]"    ,
        "[email protected]"
]    # Creating a form
    with st.form(key='blog2lead_form'):
        blog_url = st.text_input("Enter the Content URL", "")
        email_address = st.selectbox("Select your email address", email_options)
        submit_button = st.form_submit_button(label='Submit')

    if submit_button:
        if blog_url and email_address:
            # Define your data payload to send
            data_to_send = {
                "url": blog_url,
                "email_receiver": email_address
            }

            endpoint = os.getenv("blog_lead_endpoint")
            # Sending the POST request to FastAPI
            response = requests.post(endpoint, json=data_to_send)

            # Handling the response
            if response.status_code == 200:
                st.info("Your request has been processed successfully.")
            else:
                st.error("Data transmission failed. Please try again later.")
        else:
            st.error("Please fill out all fields.")

if __name__ == "__main__":
    logo_url = "https://i.imgur.com/WYnv26e.jpeg"  # Replace this with your image's direct URL
    st.markdown(
        f"""
        <style>
        .logo {{
            position: fixed;
            bottom: 5px;
            right: 5px;
            width: 100px;  # Adjust width as needed
        }}
        </style>
        <img src="{logo_url}" class="logo">
        """,
        unsafe_allow_html=True,
    )

    main()