8000 WIP; Backported features from stable branch · appscluster/python-readability@5855beb · GitHub
[go: up one dir, main page]

Skip to content

Commit 5855beb

Browse files
committed
WIP; Backported features from stable branch
1 parent ae1f1ad commit 5855beb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

readability/readability.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ def sanitize(self, node, candidates):
435435
for kind in ['p', 'img', 'li', 'a', 'embed', 'input']:
436436
counts[kind] = len(el.findall('.//%s' % kind))
437437
counts["li"] -= 100
438+
counts["input"] -= len(el.findall('.//input[@type="hidden"]'))
438439

439440
# Count the text length excluding any surrounding whitespace
440441
content_length = text_length(el)
@@ -590,6 +591,9 @@ def main():
590591
parser.add_option('-b', '--browser', default=None, action='store_true', help="open in browser")
591592
parser.add_option('-l', '--log', default=None, help="use filename for logs (appended)")
592593
parser.add_option('-u', '--url', default=None, help="use URL instead of a local file")
594+
parser.add_option('-s', '--show-xpath', default=None, help="show xpath")
595+
parser.add_option('-x', '--xpath', default=None, help="use xpath")
596+
parser.add_option('-t', '--support-text', default=None, help="use this support text")
593597
parser.add_option('-p', '--positive-keywords', default=None, help="positive keywords (separated with comma)", action='store')
594598
parser.add_option('-n', '--negative-keywords', default=None, help="negative keywords (separated with comma)", action='store')
595599
(options, args) = parser.parse_args()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name="readability-lxml",
15-
version="0.4.0.b1",
15+
version="0.5.0.2",
1616
author="Yuri Baburov",
1717
author_email="burchik@gmail.com",
1818
description="fast python port of arc90's readability tool",

0 commit comments

Comments
 (0)
0