mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 06:26:17 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6def743902 | ||
|
|
8a44926392 | ||
|
|
8c7740f073 | ||
|
|
6a4720c951 | ||
|
|
7a9a82b543 | ||
|
|
8a91d36294 | ||
|
|
669adfb20f | ||
|
|
445b889efb | ||
|
|
8b1c3f147d |
+1
-1
@@ -46,7 +46,7 @@ before_script:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- mkdir -p build/logs
|
- mkdir -p build/logs
|
||||||
- phpunit -v --coverage-clover build/logs/clover.xml
|
- php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml
|
||||||
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
|
- if [ "$CS_FIXER" = "run" ]; then php vendor/bin/php-cs-fixer fix --verbose --dry-run ; fi;
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ The default php-readability lib is really old and needs to be improved. I found
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
By default, this lib will use the [Tidy extension](https://github.com/htacg/tidy-html5) if it's available. Tidy is only used to cleanup the given HTML and avoid problems with bad HTML structure, etc ..
|
By default, this lib will use the [Tidy extension](https://github.com/htacg/tidy-html5) if it's available. Tidy is only used to cleanup the given HTML and avoid problems with bad HTML structure, etc .. It'll be suggested by Composer.
|
||||||
|
|
||||||
Since Composer doesn't support suggestion on PHP extension, I write this suggestion here.
|
Also, if you got problem from parsing a content without Tidy installed, please install it and try again.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -25,12 +25,17 @@
|
|||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.3",
|
"php": ">=5.3.3",
|
||||||
|
"ext-mbstring": "*",
|
||||||
"psr/log": "^1.0"
|
"psr/log": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"satooshi/php-coveralls": "~0.6",
|
"satooshi/php-coveralls": "~0.6",
|
||||||
"friendsofphp/php-cs-fixer": "<2",
|
"friendsofphp/php-cs-fixer": "<2",
|
||||||
"monolog/monolog": "^1.13"
|
"monolog/monolog": "^1.13",
|
||||||
|
"symfony/phpunit-bridge": "^3.2"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure."
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Readability\\": "src/" }
|
"psr-4": { "Readability\\": "src/" }
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ class Readability implements LoggerAwareInterface
|
|||||||
* Defined up here so we don't instantiate them repeatedly in loops.
|
* Defined up here so we don't instantiate them repeatedly in loops.
|
||||||
*/
|
*/
|
||||||
public $regexps = array(
|
public $regexps = array(
|
||||||
'unlikelyCandidates' => '/display\s*:\s*none|ignore|\binfos?\b|annoy|clock|date|time|author|intro|links|hidd?e|about|archive|\bprint|bookmark|tags|tag-list|share|search|social|robot|published|combx|comment|mast(?:head)|subscri|community|category|disqus|extra|head|head(?:er|note)|floor|foot(?:er|note)|menu|tool\b|function|nav|remark|rss|shoutbox|widget|meta|banner|sponsor|adsense|inner-?ad|ad-|sponsor|\badv\b|\bads\b|agr?egate?|pager|sidebar|popup|tweet|twitter/i',
|
'unlikelyCandidates' => '/display\s*:\s*none|ignore|\binfos?\b|annoy|clock|date|time|author|intro|hidd?e|about|archive|\bprint|bookmark|tags|tag-list|share|search|social|robot|published|combx|comment|mast(?:head)|subscri|community|category|disqus|extra|head|head(?:er|note)|floor|foot(?:er|note)|menu|tool\b|function|nav|remark|rss|shoutbox|widget|meta|banner|sponsor|adsense|inner-?ad|ad-|sponsor|\badv\b|\bads\b|agr?egate?|pager|sidebar|popup|tweet|twitter/i',
|
||||||
'okMaybeItsACandidate' => '/article\b|contain|\bcontent|column|general|detail|shadow|lightbox|blog|body|entry|main|page/i',
|
'okMaybeItsACandidate' => '/article\b|contain|\bcontent|column|general|detail|shadow|lightbox|blog|body|entry|main|page/i',
|
||||||
'positive' => '/read|full|article|body|\bcontent|contain|entry|main|markdown|page|attach|pagination|post|text|blog|story/i',
|
'positive' => '/read|full|article|body|\bcontent|contain|entry|main|markdown|page|attach|pagination|post|text|blog|story/i',
|
||||||
'negative' => '/bottom|stat|info|discuss|e[\-]?mail|comment|reply|log.{2}(n|ed)|sign|single|combx|com-|contact|_nav|link|media|\bout|promo|\bad-|related|scroll|shoutbox|sidebar|sponsor|shopping|teaser|recommend/i',
|
'negative' => '/bottom|stat|info|discuss|e[\-]?mail|comment|reply|log.{2}(n|ed)|sign|single|combx|com-|contact|_nav|link|media|\bout|promo|\bad-|related|scroll|shoutbox|sidebar|sponsor|shopping|teaser|recommend/i',
|
||||||
|
|||||||
Reference in New Issue
Block a user