File size: 2,158 Bytes
5f6b981
 
 
 
199c939
 
5f6b981
 
 
 
199c939
 
 
 
 
 
 
 
 
 
 
 
5f6b981
 
199c939
 
5f6b981
 
 
199c939
5f6b981
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
afda687
5f6b981
afda687
 
 
5f6b981
 
 
 
 
afda687
5f6b981
199c939
5f6b981
 
 
 
 
 
 
 
 
 
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
63
64
65
66
67
68
69
70
71
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import streamlit as st
import re
import json
import os

# Page Configuration
st.set_page_config(page_title="FurOmics", page_icon="🐾", layout="centered")

def get_google_keys():
    google_secrets = st.secrets["google"]
    if google_secrets is None:
        google_secrets = os.getenv("google", None)
    if isinstance(google_secrets, str):
        google_secrets = json.loads(google_secrets)

    if google_secrets is None:
        raise Exception("google api keys could not be initialized")

    return google_secrets

# Function to add email to Google Sheets
def add_email_to_sheet(email):
    google_secrets = get_google_keys()
    
    try:
        # Set up Google Sheets API client
        scopes = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
        creds = ServiceAccountCredentials.from_json_keyfile_dict(google_secrets, scopes)
        client = gspread.authorize(creds)

        # Open the sheet and append the email
        sheet = client.open("FurOmics Waitlist").sheet1
        sheet.append_row([email])

        return True
    except Exception as e:
        st.error(f"An error occurred: {e}")
        return False

# Header
st.title("FurOmics 🐈 🦮🐾")
st.subheader("The Omics solution to our furry friends!")
st.image("catanddog_300x200.jpg", caption="Healthy pets, happier lives.")

# About Section
st.header("About")
st.write("""
        🤖  Deep Learning engine
        🧬  Genome analysis
        😻  Furry Friends care
""")

st.subheader("COMING SOON!")
# Waitlist Form
st.header("Join Our Waitlist")
email = st.text_input("Be first to know when our platform launches! 🚀 Leave an email:")
if st.button("Join Waitlist"):
    if email and re.match(r"^[a-z0-9_-]+@[^@]+\.[a-z]+$", email):
        success = add_email_to_sheet(email)
        if success:
            st.success("Thank you for joining the waitlist!")
    else:
        st.error("Please enter a valid email address.")


# Footer
st.markdown("---")
st.write("Follow us on [X](https://x.com/FurOmics) | [email](mailto:[email protected])")