From 3fc89d5359277ace5ff2090550dd79805f22894c Mon Sep 17 00:00:00 2001 From: pictuga Date: Wed, 1 Mar 2017 18:02:45 -1000 Subject: [PATCH] readabilite: improve score for

Helps a lot with bbc, le monde. Might backfire on other websites tho... --- morss/readabilite.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/morss/readabilite.py b/morss/readabilite.py index 993f620..15f11b1 100644 --- a/morss/readabilite.py +++ b/morss/readabilite.py @@ -63,6 +63,9 @@ def score_node(node): if node.tag in ['h1', 'h2', 'article']: score += 8 + if node.tag in ['p']: + score += 3 + class_id = node.get('class', '') + node.get('id', '') score += len(regex_good.findall(class_id) * 4)