parent
52661985d1
commit
60e3311e97
|
@ -15,6 +15,7 @@ import lxml.html
|
||||||
from . import feeds
|
from . import feeds
|
||||||
from . import feedify
|
from . import feedify
|
||||||
from . import crawler
|
from . import crawler
|
||||||
|
from . import readabilite
|
||||||
|
|
||||||
import wsgiref.simple_server
|
import wsgiref.simple_server
|
||||||
import wsgiref.handlers
|
import wsgiref.handlers
|
||||||
|
@ -79,12 +80,6 @@ def log(txt, force=False):
|
||||||
print(repr(txt))
|
print(repr(txt))
|
||||||
|
|
||||||
|
|
||||||
from . import readabilite
|
|
||||||
def readability(html, url):
|
|
||||||
return readabilite.get_article(html)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def len_html(txt):
|
def len_html(txt):
|
||||||
if len(txt):
|
if len(txt):
|
||||||
return len(lxml.html.fromstring(txt).text_content())
|
return len(lxml.html.fromstring(txt).text_content())
|
||||||
|
@ -287,7 +282,7 @@ def Fill(item, options, feedurl='/', fast=False):
|
||||||
log('non-text page')
|
log('non-text page')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
out = readability(data, con.url)
|
out = readabilite.get_article(data)
|
||||||
|
|
||||||
if options.hungry or count_words(out) > max(count_content, count_desc):
|
if options.hungry or count_words(out) > max(count_content, count_desc):
|
||||||
item.push_content(out)
|
item.push_content(out)
|
||||||
|
|
Loading…
Reference in New Issue