Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import time
|
| 3 |
+
import sched
|
| 4 |
+
from datetime import datetime
|
| 5 |
+
|
| 6 |
+
# ์ค์ผ์ค๋ฌ ์ด๊ธฐํ
|
| 7 |
+
s = sched.scheduler(time.time, time.sleep)
|
| 8 |
+
|
| 9 |
+
# URL ๋ฆฌ์คํธ (์ด 100๊ฐ์ URL์ด ์๋ค๊ณ ๊ฐ์ )
|
| 10 |
+
urls = [
|
| 11 |
+
"https://ginipick-gini-llm-chatbot-text.hf.space",
|
| 12 |
+
"https://ginipick-gini-llm-chat-speech.hf.space",
|
| 13 |
+
"https://ginipick-gini-llm-blog.hf.space",
|
| 14 |
+
"https://fantaxy-kai-chat-speech.hf.space",
|
| 15 |
+
"https://fantaxy-kai-tts.hf.space",
|
| 16 |
+
"https://fantaxy-kai-ytb-audio.hf.space",
|
| 17 |
+
"https://fantaxy-kai-ytb-blog.hf.space",
|
| 18 |
+
"https://fantaxy-kai-girlfriend19.hf.space",
|
| 19 |
+
"https://fantaxy-kai-person-lee.hf.space",
|
| 20 |
+
"https://fantaxy-kai-person-jobs.hf.space",
|
| 21 |
+
"https://fantaxy-kai-person-eins.hf.space",
|
| 22 |
+
"https://fantaxy-kai-person-musk.hf.space",
|
| 23 |
+
"https://fantaxy-kai-person-hwang.hf.space",
|
| 24 |
+
"https://ginipick-kai-commu-1253181171853164544.hf.space",
|
| 25 |
+
"https://ginipick-kai-commu-1253181193180942367.hf.space",
|
| 26 |
+
"https://ginipick-kai-commu-1253181238676557884.hf.space",
|
| 27 |
+
"https://ginipick-kai-commu-1253181258561884161.hf.space",
|
| 28 |
+
"https://ginipick-kai-commu-1253181305739411567.hf.space",
|
| 29 |
+
"https://ginipick-kai-commu-1253181326060949585.hf.space",
|
| 30 |
+
"https://ginipick-kai-commu-1253181359371980892.hf.space",
|
| 31 |
+
"https://ginipick-kai-commu-1253181380091973715.hf.space",
|
| 32 |
+
"https://ginipick-kai-commu-1253181427605045329.hf.space",
|
| 33 |
+
"https://ginipick-kai-commu-1253181449008320553.hf.space",
|
| 34 |
+
"https://ginipick-kai-commu-1253181487818211348.hf.space",
|
| 35 |
+
"https://ginipick-kai-commu-1253181517593837568.hf.space",
|
| 36 |
+
"https://ginipick-kai-commu-1253181557233946665.hf.space",
|
| 37 |
+
"https://ginipick-kai-commu-1253181575252803634.hf.space",
|
| 38 |
+
"https://ginipick-kai-commu-1253181626750341141.hf.space"
|
| 39 |
+
# ์ฌ๊ธฐ์ ์ถ๊ฐ URL์ ์ถ๊ฐํ์ธ์
|
| 40 |
+
]
|
| 41 |
+
|
| 42 |
+
# URL์ ์ ์์ ์๋ํ๋ ํจ์
|
| 43 |
+
def check_url(url):
|
| 44 |
+
try:
|
| 45 |
+
response = requests.get(url)
|
| 46 |
+
status = response.status_code
|
| 47 |
+
print(f"{datetime.now()}: {url} - ์ํ ์ฝ๋: {status}")
|
| 48 |
+
except requests.RequestException as e:
|
| 49 |
+
print(f"{datetime.now()}: {url} - ์ค๋ฅ: {e}")
|
| 50 |
+
|
| 51 |
+
# ๋ชจ๋ URL์ ์ฒดํฌํ๋ ํจ์
|
| 52 |
+
def check_all_urls():
|
| 53 |
+
for url in urls:
|
| 54 |
+
check_url(url)
|
| 55 |
+
schedule_next_run()
|
| 56 |
+
|
| 57 |
+
# ๋ค์ ์คํ์ ์์ฝํ๋ ํจ์ (15๋ถ๋ง๋ค ์คํ)
|
| 58 |
+
def schedule_next_run():
|
| 59 |
+
s.enter(900, 1, check_all_urls) # 900์ด = 15๋ถ
|
| 60 |
+
print(f"{datetime.now()}: ๋ค์ ์คํ์ด ์์ฝ๋์์ต๋๋ค.")
|
| 61 |
+
|
| 62 |
+
# ์ด๊ธฐ ์คํ
|
| 63 |
+
print(f"{datetime.now()}: ํ๋ก๊ทธ๋จ ์์")
|
| 64 |
+
schedule_next_run()
|
| 65 |
+
|
| 66 |
+
# ์ค์ผ์ค๋ฌ ์คํ
|
| 67 |
+
s.run()
|