summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Rey <[email protected]>2018-03-13 19:39:43 +0000
committerAndres Rey <[email protected]>2018-03-13 19:39:43 +0000
commitf05d753620e1039d77030a955ce63013b1d5196b (patch)
tree790ec9772ed1c320d0546fb449338722268f3b94
parentfd5a2718ac231c3220aea9c5fb78570f86daf1f1 (diff)
Update readme
-rw-r--r--README.md22
1 files changed, 16 insertions, 6 deletions
diff --git a/README.md b/README.md
index 5b19de6..a0d39d9 100644
--- a/README.md
+++ b/README.md
@@ -7,14 +7,14 @@ PHP port of *Mozilla's* **[Readability.js](https://github.com/mozilla/readabilit
The project aim is to be a 1 to 1 port of Mozilla's version and to follow closely all changes introduced there, but there are some major differences on the structure. Most of the code is a 1:1 copy –even the comments were imported– but some functions and structures were adapted to suit better the PHP language.
+**Lead Developer**: Andres Rey
+
## Requirements
PHP 5.6+, ext-dom, ext-xml, and ext-mbstring. To install all this dependencies (in the rare case your system does not have them already), you could try something like this in *nix like environments:
`$ sudo apt-get install php7.1-xml php7.1-mbstring`
-**Lead Developer**: Andres Rey
-
## How to use it
First you have to require the library using composer:
@@ -68,11 +68,21 @@ You can change the behaviour of Readability via the Configuration object. For ex
```php
$configuration = new Configuration();
-$configuration->setFixRelativeURLs(true)
+$configuration
+ ->setFixRelativeURLs(true)
->setOriginalURL('http://my.newspaper.url/article/something-interesting-to-read.html');
```
+Also you can pass an array of configuration parameters to the constructor:
+```php
+$configuration = new Configuration([
+ 'fixRelativeURLs' => true,
+ 'originalURL' => 'http://my.newspaper.url/article/something-interesting-to-read.html',
+ // other parameters ... listing below
+]);
+```
+
-Then you pass this Configuration object to Readability. The following options are available. Remember to prepend `set` when calling them.
+Then you pass this Configuration object to Readability. The following options are available. Remember to prepend `set` when calling them using native setters.
- **MaxTopCandidates**: default value `5`, max amount of top level candidates.
- **WordThreshold**: default value `500`, minimum amount of characters to consider that the article was parsed successful.
@@ -155,7 +165,7 @@ Readability parses all the text with DOMDocument, scans the text nodes and gives
## Code porting
-Up to date with readability.js as of [16 Oct 2017](https://github.com/mozilla/readability/commit/c3ff1a2d2c94c1db257b2c9aa88a4b8fbeb221c5).
+Up to date with readability.js as of [2 Mar 2018](https://github.com/mozilla/readability/commit/8525c6af36d3badbe27c4672a6f2dd99ddb4097f).
## License
@@ -173,4 +183,4 @@ Based on Arc90's readability.js (1.7.1) script available at: http://code.google.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License. \ No newline at end of file
+ limitations under the License.