Back the fun of reading - PHP Port for Arc90′s Readability

Overview

PHP Readability Library

If you want to use an up-to-date version of this algorithm,check this newer project:

https://github.com/andreskrey/readability.php

Back the fun of reading

The PHP port of Readability.js by Arc90.

Requirements

Live demo

http://graceco.de/readability/

Usage

require 'lib/Readability.inc.php';

$Readability     = new Readability($html, $html_input_charset); // default charset is utf-8
$ReadabilityData = $Readability->getContent(); // throws an exception when no suitable content is found

// You can see more params by var_dump($ReadabilityData);
echo "<h1>".$ReadabilityData['title']."</h1>";
echo $ReadabilityData['content'];

PS: For Node.js port, You can check this.

Comments
  • It does not work with img_url, word count and other entities provided by readability

    It does not work with img_url, word count and other entities provided by readability

    $Readability = new Readability($html); // default charset is utf-8 $ReadabilityData = $Readability->getContent();

    $title = $ReadabilityData['title']; $word_count= $ReadabilityData['word_count']; $img= $ReadabilityData['lead_image_url'];

    here word_count and lead_image_url are found undefined ..

    Referring this doc: https://www.readability.com/developers/api/parser

    opened by karimkhanp 2
  • Demo page is not working

    Demo page is not working

    You serve your page via https but your css is served over http.

    Mixed Content: The page at 'https://graceco.de/readability/' was loaded over HTTPS, but requested an insecure stylesheet 'http://cdn.staticfile.org/meyer-reset/2.0/reset.css'. This request has been blocked; the content must be served over HTTPS.
    
    opened by tujlaky 1
  • A page that php-readability failed to extract

    A page that php-readability failed to extract

    Hello,

    php-readability could not parse this page: http://www.business-standard.com/article/international/why-facebook-dropped-a-whopping-19-billion-on-whatsapp-114022000309_1.html

    I also tested it on the original readability javascript and it works fine.

    Could you take a look this? Thanks!

    opened by linziheng 1
  • php-readability returns gibberish text

    php-readability returns gibberish text

    Hi,

    php-readability is a GREAT tool and I really enjoy using it!

    Found a few urls that always return source code instead of text: http://www.theage.com.au/business/retail/watch-out-woolies-aldis-rapid-growth-could-open-the-door-for-others-20140212-32i11.html http://www.smh.com.au/business/the-economy/janet-yellen-stays-the-course-in-first-testimony-as-fed-chair-20140212-32gia.html

    For example: http://graceco.de/readability/?url=http%3A%2F%2Fwww.smh.com.au%2Fbusiness%2Fthe-economy%2Fjanet-yellen-stays-the-course-in-first-testimony-as-fed-chair-20140212-32gia.html

    Could you fix this issue?

    Thanks so much!

    opened by linziheng 1
  • Success boolean

    Success boolean

    It would be nice to be able to check for a success state. Rather than to display Sorry, readability was unable to parse this page for content. to the user.

    opened by Beanow 0
Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.

Quiritibus Plugin This repository is storing the custom plugin developed for the Quiritibus Latin Magazine website, currently being developed at: http

Alkor András 1 Jan 19, 2022
❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

OpenGento 6 Apr 30, 2022
A library for reading and writing DNA test kit files in PHP.

php-dna Requirements php-dna 1.0+ requires PHP 8.0 (or later). Installation There are two ways of installing php-dna. Composer To install php-dna in y

Family Tree 365 4 Aug 31, 2022
PHP implementation for reading and writing Apache Parquet files/streams

php-parquet This is the first parquet file format reader/writer implementation in PHP, based on the Thrift sources provided by the Apache Foundation.

null 17 Oct 25, 2022
A pure PHP library for reading and writing presentations documents

Branch Master : Branch Develop : PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation fi

PHPOffice 1.2k Jan 2, 2023
A PHP web interface for scanning ISBN book codes, identify books with Antolin reading promotion offer

Ein PHP-Webinterface zum Scannen von ISBN-Buchcodes, identifiziere Bücher mit Antolin-Leseförderungs-Angebot. Einfache Installation. Für Mitarbeiter*innen in Schulbüchereien.

null 2 May 20, 2022
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

Lodash PHP 474 Dec 31, 2022
A redacted PHP port of Underscore.js with additional functions and goodies – Available for Composer and Laravel

Underscore.php The PHP manipulation toolbelt First off : Underscore.php is not a PHP port of Underscore.js (well ok I mean it was at first). It's does

Emma Fabre 1.1k Dec 11, 2022
Port of the Java Content Repository (JCR) to PHP.

PHP Content Repository PHPCR This repository contains interfaces for the PHPCR standard. The JSR-283 specification defines an API for a Content Reposi

PHPCR 436 Dec 30, 2022
A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP.

A simple, type-safe, zero dependency port of the javascript fetch WebApi for PHP.

Matias Navarro Carter 105 Jan 4, 2023
An improved version of the PHP port of KuzuhaScript

KuzuhaScriptPHP+ (くずはすくりぷとPHP+) An improved version of the PHP port of KuzuhaScript (くずはすくりぷと). To my knowledge, it works with PHP version 4.1.0 and a

Heyuri 4 Nov 16, 2022
A PHP port of Ruby's Liquid Templates

Liquid template engine for PHP Liquid is a PHP port of the Liquid template engine for Ruby, which was written by Tobias Lutke. Although there are many

Alexander Guz 141 Nov 4, 2022
This is a port of the original WireGuard UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for rapid iteration and more frequent updating on future releases of pfSense.

This is a port of the original WireGuard*** UI bits as implemented by Netgate in pfSense 2.5.0 to a package suitable for sideloading and more frequent updating on future releases of pfSense. This also includes some improvments such as a proper status page (found under Status / WireGuard Status) and improved assigned interface handling.

R. Christian McDonald 195 Dec 23, 2022
A class for easy connection to the zarinpal port

Payment class with ZarinPal A class to simplify payment operations and confirm payment of ZarrinPal payment gateway service ( به فارسی بخوانید ) Insta

Mohammad Qasemi 7 Jul 15, 2022
uaDetect – A multi-language port of Browserscope's user agent parser

uaDetect is a lightweight for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

Fadjrir Herlambang 1 Jan 7, 2022
PHP class for convert KA letters to LAT and back

Kautilities PHP class for convert KA letters to LAT and back Installation Install this package through Composer. Edit your project's composer.json fil

Avtandil Kikabidze 4 Jan 11, 2018
A back-off strategy interface for retrying operations.

EventSauce BackOff This library provides an interface for encapsulated back-off strategies. composer require eventsauce/backoff Leveraging the back-of

EventSauce 59 Dec 19, 2022
A PocketMine-MP plugin that replaces a block to another block when breaks, then back to the original block after a certain time

BlockReplacer A PocketMine-MP plugin that replaces a block to another block when breaks, then back to the original block after a certain time How to I

AIPTU 11 Sep 2, 2022
Mapa avaliativo de back end I

2021 | Aluno: BRUNO J. VASCONCELOS BOA SORTE | RA: 20061660-5

Bruno Boa Sorte 2 Apr 16, 2022