From 60e3311e97da9441f91d910017f3c028c3f58454 Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 28 Feb 2017 22:45:26 -1000 Subject: [PATCH] Use readabilite properly Not thru some weird wrapper anymore --- morss/morss.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/morss/morss.py b/morss/morss.py index 2fb38a0..651ea7d 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -15,6 +15,7 @@ import lxml.html from . import feeds from . import feedify from . import crawler +from . import readabilite import wsgiref.simple_server import wsgiref.handlers @@ -79,12 +80,6 @@ def log(txt, force=False): print(repr(txt)) -from . import readabilite -def readability(html, url): - return readabilite.get_article(html) - - - def len_html(txt): if len(txt): return len(lxml.html.fromstring(txt).text_content()) @@ -287,7 +282,7 @@ def Fill(item, options, feedurl='/', fast=False): log('non-text page') return True - out = readability(data, con.url) + out = readabilite.get_article(data) if options.hungry or count_words(out) > max(count_content, count_desc): item.push_content(out)