-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcms.py
More file actions
28 lines (23 loc) · 651 Bytes
/
cms.py
File metadata and controls
28 lines (23 loc) · 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from urllib.request import urlopen
import io
def get_cms(url):
if url.endswith('/'):
path=url
else:
path=url+'/'
print('-------------------------------------')
print("Detecting CMS used.....")
try:
html=urlopen(path+"robots.txt")
c=html.read().decode('utf-8')
if '/wp-admin/' in c:
print("WordPress")
elif '/_api/*' in c:
print("Wix")
elif 'Joomla' in c:
print("Joomla")
else:
print("Cannot Identify CMS used")
return(html.read().decode('utf-8'))
except:
print("Cannot Identify CMS used")