JaeSwift commited on
Commit
8bdd2a0
·
verified ·
1 Parent(s): 46cf59d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -1,6 +1,21 @@
1
  import gradio as gr
2
  import requests
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  PLACEHOLDER = """
5
  <center>
6
  <p><strong>Daily Horoscope by Enemy AI</strong></p>
 
1
  import gradio as gr
2
  import requests
3
 
4
+ # Check internet access
5
+ def check_internet_access():
6
+ try:
7
+ response = requests.get("https://httpbin.org/ip", timeout=5)
8
+ response.raise_for_status()
9
+ print("Internet access confirmed.")
10
+ print("Your public IP:", response.json().get("origin"))
11
+ except requests.exceptions.RequestException as e:
12
+ print("No internet access:", e)
13
+
14
+ # Run the internet check
15
+ check_internet_access()
16
+
17
+ # The rest of your horoscope bot code follows...
18
+
19
  PLACEHOLDER = """
20
  <center>
21
  <p><strong>Daily Horoscope by Enemy AI</strong></p>