Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,9 @@ from datetime import datetime
|
|
| 6 |
|
| 7 |
DEFAULT_SYSTEM_PROMPT = """
|
| 8 |
List of Tools:
|
| 9 |
-
- Sitespeed Checker - Check how fast monitored sites are in seconds. To use, just type '
|
|
|
|
|
|
|
| 10 |
- Ads Checker - Shows the links of possible paid ads. To use, type the domain without 'https://www'.
|
| 11 |
"""
|
| 12 |
|
|
@@ -54,7 +56,7 @@ def check_robots(url):
|
|
| 54 |
try:
|
| 55 |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}
|
| 56 |
response = requests.head(url, timeout=10)
|
| 57 |
-
if response.status_code == 200 or response.status_code == 401:
|
| 58 |
return('OK')
|
| 59 |
else:
|
| 60 |
return(response.status_code)
|
|
@@ -67,7 +69,7 @@ def check_sitemap(url):
|
|
| 67 |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}
|
| 68 |
new_url = url +"/sitemap.xml"
|
| 69 |
response = requests.head(url, timeout=10)
|
| 70 |
-
if response.status_code == 200 or response.status_code == 401:
|
| 71 |
return('OK')
|
| 72 |
else:
|
| 73 |
return(response.status_code)
|
|
@@ -112,7 +114,7 @@ def check_site_speed(url):
|
|
| 112 |
|
| 113 |
def runchecks(message,history):
|
| 114 |
results = []
|
| 115 |
-
if message == '
|
| 116 |
results.append(['Website','Speed in Seconds'])
|
| 117 |
for site in websites:
|
| 118 |
print(f"Checking site speed for {site}...")
|
|
|
|
| 6 |
|
| 7 |
DEFAULT_SYSTEM_PROMPT = """
|
| 8 |
List of Tools:
|
| 9 |
+
- Sitespeed Checker - Check how fast monitored sites are in seconds. To use, just type 'check speed'.
|
| 10 |
+
- Sitemap Checker - Check if a site has a sitemap. To use, just type 'check sitemap'.
|
| 11 |
+
- Robots.txt Checker - Check if a site has robots.txt. To use, just type 'check bots'.
|
| 12 |
- Ads Checker - Shows the links of possible paid ads. To use, type the domain without 'https://www'.
|
| 13 |
"""
|
| 14 |
|
|
|
|
| 56 |
try:
|
| 57 |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}
|
| 58 |
response = requests.head(url, timeout=10)
|
| 59 |
+
if response.status_code == 200 or response.status_code == 401 or response.status_code == 302:
|
| 60 |
return('OK')
|
| 61 |
else:
|
| 62 |
return(response.status_code)
|
|
|
|
| 69 |
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"}
|
| 70 |
new_url = url +"/sitemap.xml"
|
| 71 |
response = requests.head(url, timeout=10)
|
| 72 |
+
if response.status_code == 200 or response.status_code == 401 or response.status_code == 302:
|
| 73 |
return('OK')
|
| 74 |
else:
|
| 75 |
return(response.status_code)
|
|
|
|
| 114 |
|
| 115 |
def runchecks(message,history):
|
| 116 |
results = []
|
| 117 |
+
if message == 'check speed' or message == 'Check Speed':
|
| 118 |
results.append(['Website','Speed in Seconds'])
|
| 119 |
for site in websites:
|
| 120 |
print(f"Checking site speed for {site}...")
|