rsstube/scripts/determine_software.py

22 lines
593 B
Python

#!/usr/bin/python3
supported_software = {
"bibliogram" : [
'<meta name="generator" content="Bibliogram">',
'<link rel="manifest" href="/bibliogram.webmanifest">',
'<meta property="og:site_name" content="Bibliogram">',
'<section class="bibliogram-meta">'
],
"peertube" : [
'<meta property="og:platform" content="PeerTube"'
]
}
def determine_software (page):
from utils import search
software = None
for possible_software in supported_software:
for pattern in supported_software[possible_software]:
if not search (page, pattern, "") is None:
return possible_software