Spaces:
Runtime error
Runtime error
Update app.py
Browse files15 unmodified lines161718192021222324252627282930313233343536373839404142434445464748495051525315 unmodified linesdef save_to_google_apps_script(data):"""Saves the submitted event data via Google Apps Script."""try:# Debug: Show what data is being sentst.write("Debug - Data being sent:", data)response = requests.post(GOOGLE_APPS_SCRIPT_URL,json=data,timeout=30,headers={'Content-Type': 'application/json'})# Debug: Show response detailsst.write(f"Debug - Response status: {response.status_code}")st.write(f"Debug - Response text: {response.text}")if response.status_code == 200:try:result = response.json()if result.get('result') == 'success':return True, "Data submitted successfully! We'll be in touch soon."else:return False, f"Script error: {result.get('message', 'Unknown error')}"except:# If response is not JSON, treat as success if status is 200return True, "Data submitted successfully! We'll be in touch soon."else:return False, f"Submission failed with status code: {response.status_code}"except requests.exceptions.Timeout:return False, "Request timed out. Please try again later."except Exception as e:return False, f"Error submitting data: {str(e)}"def scrape_website(url):"""Scrapes company content from the given website URL."""if not url.startswith("http"):15 unmodified lines1617181920212215 unmodified linesdef save_to_google_apps_script(data):"""Saves the submitted event data via Google Apps Script."""try:def scrape_website(url):"""Scrapes company content from the given website URL."""if not url.startswith("http"):
app.py-31