From 6ae60d0343fe1618ecb8cafc9d49497d0e4c6aa2 Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 3 Mar 2015 01:03:03 +0800 Subject: [PATCH] 2to3: py3-compatible readability fork --- README.md | 2 +- morss/morss.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7ea6851..c49d331 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ You can use this program online for free at **[morss.it](http://morss.it/)** (th You do need: - [python](http://www.python.org/) >= 2.6 < 3 - [lxml](http://lxml.de/) for xml parsing -- [this](https://github.com/buriy/python-readability) readability fork +- [this](https://github.com/bookieio/breadability) readability fork - [dateutil](http://labix.org/python-dateutil) to parse feed dates - [html2text](http://www.aaronsw.com/2002/html2text/) - [OrderedDict](https://pypi.python.org/pypi/ordereddict) if using python < 2.7 diff --git a/morss/morss.py b/morss/morss.py index d08b355..96c9b31 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -20,7 +20,7 @@ from . import crawler import wsgiref.simple_server import wsgiref.handlers -from readability import readability +import breadability.readable from html2text import HTML2Text try: @@ -397,7 +397,7 @@ def Fill(item, cache, options, feedurl='/', fast=False): cache.set(link, 'error-type') return True - out = readability.Document(data, url=con.url).summary(True) + out = breadability.readable.Article(data, url=con.url).readable if options.hungry or count_words(out) > max(count_content, count_desc): item.push_content(out) diff --git a/requirements.txt b/requirements.txt index ea7d669..6dfb2fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ lxml -git+https://github.com/buriy/python-readability#egg=readability-lxml +git+git://github.com/bookieio/breadability.git python-dateutil <= 1.5 html2text ordereddict