Fix contact link rating

This commit is contained in:
Marian Steinbach 2018-11-23 22:16:26 +01:00
parent 3ba6940e94
commit 39cba1595a
2 changed files with 7 additions and 0 deletions

View file

@ -28,6 +28,8 @@ class Rater(AbstractRater):
for link in self.check_results['hyperlinks'][url]['links']:
if link['text'].lower() == 'kontakt':
urls_with_contact_link += 1
# make sure we only count 1 for this url
break
if urls_with_contact_link == urls:
score = self.max_score

View file

@ -37,6 +37,11 @@ class Rater(AbstractRater):
continue
parsed = urlparse(link['href'])
if parsed is None:
continue
if parsed.hostname is None:
continue
if ("facebook.com" in parsed.hostname or
"twitter.com" in parsed.hostname or
"instagram.com" in parsed.hostname or