├── .gitignore
├── .htaccess
├── LICENSE
├── README.md
├── assets
└── css
│ ├── readability-min.css
│ ├── readability.css
│ ├── reset-min.css
│ ├── reset.css
│ ├── typography-min.css
│ └── typography.css
├── common.inc.php
├── config.inc.php
├── index.php
├── lib
└── Readability.inc.php
└── template
├── footer.inc.html
├── header.inc.html
├── index.html
└── reader.html
/.gitignore:
--------------------------------------------------------------------------------
1 | cache/*
--------------------------------------------------------------------------------
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | RewriteEngine On
3 | RewriteBase /readability/
4 |
5 | RewriteCond %{REQUEST_FILENAME} !-f
6 | RewriteCond %{REQUEST_FILENAME} !-d
7 | RewriteRule . index.php [L]
8 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) [year] [fullname]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PHP Readability Library
2 |
3 | If you want to use an up-to-date version of this algorithm,check this newer project:
4 |
5 | https://github.com/andreskrey/readability.php
6 |
7 |
8 | ## Back the fun of reading
9 |
10 | The PHP port of [Readability.js by Arc90](http://code.google.com/p/arc90labs-readability/).
11 |
12 |
13 | ## Requirements
14 |
15 | * PHP Version >= 5
16 | * [PHP has builded with DOM(Document Object Model)](http://www.php.net/manual/en/book.dom.php)
17 |
18 |
19 | ## Live demo
20 |
21 | http://graceco.de/readability/
22 |
23 |
24 | ## Usage
25 |
26 | ```
27 | require 'lib/Readability.inc.php';
28 |
29 | $Readability = new Readability($html, $html_input_charset); // default charset is utf-8
30 | $ReadabilityData = $Readability->getContent(); // throws an exception when no suitable content is found
31 |
32 | // You can see more params by var_dump($ReadabilityData);
33 | echo "