tmgztxi / wk.py
Geek7's picture
Upload wk.py
a586351 verified
raw
history blame contribute delete
462 Bytes
from apscheduler.schedulers.blocking import BlockingScheduler
import requests
url = "https://geek7-tmgztxi.hf.space"
scheduler = BlockingScheduler()
def ping():
try:
response = requests.get(url)
print(f"Pinged {url}: {response.status_code}")
except Exception as e:
print(f"Error pinging {url}: {e}")
scheduler.add_job(ping, 'interval', minutes=5)
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
pass