|
|
@ -13,9 +13,12 @@ Based on:
|
|
|
|
- Ruby port by starrhorne and iterationlabs
|
|
|
|
- Ruby port by starrhorne and iterationlabs
|
|
|
|
- Python port by gfxmonk ( https://github.com/gfxmonk/python-readability , based on BeautifulSoup )
|
|
|
|
- Python port by gfxmonk ( https://github.com/gfxmonk/python-readability , based on BeautifulSoup )
|
|
|
|
- Decruft effort to move to lxml ( http://www.minvolai.com/blog/decruft-arc90s-readability-in-python/ )
|
|
|
|
- Decruft effort to move to lxml ( http://www.minvolai.com/blog/decruft-arc90s-readability-in-python/ )
|
|
|
|
|
|
|
|
- "BR to P" fix from readability.js which improves quality for smaller texts.
|
|
|
|
|
|
|
|
- Github users contributions.
|
|
|
|
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from readability.readability import Document
|
|
|
|
import urllib
|
|
|
|
import urllib
|
|
|
|
html = urllib.urlopen(url).read()
|
|
|
|
html = urllib.urlopen(url).read()
|
|
|
|
readable_article = Document(html).summary()
|
|
|
|
readable_article = Document(html).summary()
|
|
|
@ -23,4 +26,4 @@ readable_title = Document(html).short_title()
|
|
|
|
|
|
|
|
|
|
|
|
Command-line usage:
|
|
|
|
Command-line usage:
|
|
|
|
|
|
|
|
|
|
|
|
python -m readability.readability -u http://yoursite.com/yourpage
|
|
|
|
python -m readability.readability -u http://pypi.python.org/pypi/readability-lxml
|
|
|
|