Download wk.py from Geek7/mdztxi2: direct link, hf CLI and curl.
- Browser
- Download file 463 Bytes
-
https://huggingface.co/spaces/Geek7/mdztxi2/resolve/main/wk.py
- Command line
-
hf download hf://spaces/Geek7/mdztxi2/wk.py
-
curl -L -o wk.py https://huggingface.co/spaces/Geek7/mdztxi2/resolve/main/wk.py
463 Bytes
| from apscheduler.schedulers.blocking import BlockingScheduler | |
| import requests | |
| url = "https://geek7-mdztxi2.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=15) | |
| try: | |
| scheduler.start() | |
| except (KeyboardInterrupt, SystemExit): | |
| pass |