Update PicoFeed (Better Xpath query for favicons)

This commit is contained in:
Frederic Guillot 2017-01-15 22:21:21 -05:00
parent 856f5fc02f
commit dbe82bb58c
4 changed files with 16 additions and 16 deletions

View File

@ -17,7 +17,7 @@
"fguillot/simple-validator": "v1.0.0", "fguillot/simple-validator": "v1.0.0",
"fguillot/json-rpc": "v1.2.3", "fguillot/json-rpc": "v1.2.3",
"fguillot/picodb": "v1.0.14 ", "fguillot/picodb": "v1.0.14 ",
"fguillot/picofeed": "v0.1.30", "fguillot/picofeed": "v0.1.31",
"pda/pheanstalk": "v3.1.0", "pda/pheanstalk": "v3.1.0",
"ircmaxell/password-compat": "^1.0.4" "ircmaxell/password-compat": "^1.0.4"
}, },

14
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "c801ae93ae28d98a0c8786921d325a53", "hash": "84a5e3b6cc5bebc61559f062e3d3cb6f",
"content-hash": "6f772b24ec9a4cc603ef6060b3df7865", "content-hash": "7964640dd4d057358aeb236996973c90",
"packages": [ "packages": [
{ {
"name": "fguillot/json-rpc", "name": "fguillot/json-rpc",
@ -88,16 +88,16 @@
}, },
{ {
"name": "fguillot/picofeed", "name": "fguillot/picofeed",
"version": "v0.1.30", "version": "v0.1.31",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fguillot/picoFeed.git", "url": "https://github.com/fguillot/picoFeed.git",
"reference": "f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7" "reference": "b753961879d0b92c284971d902355e00cad1fd9b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7", "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/b753961879d0b92c284971d902355e00cad1fd9b",
"reference": "f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7", "reference": "b753961879d0b92c284971d902355e00cad1fd9b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -137,7 +137,7 @@
], ],
"description": "Modern library to handle RSS/Atom feeds", "description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/fguillot/picoFeed", "homepage": "https://github.com/fguillot/picoFeed",
"time": "2017-01-15 20:30:23" "time": "2017-01-16 03:10:21"
}, },
{ {
"name": "fguillot/simple-validator", "name": "fguillot/simple-validator",

View File

@ -265,17 +265,17 @@
}, },
{ {
"name": "fguillot/picofeed", "name": "fguillot/picofeed",
"version": "v0.1.30", "version": "v0.1.31",
"version_normalized": "0.1.30.0", "version_normalized": "0.1.31.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fguillot/picoFeed.git", "url": "https://github.com/fguillot/picoFeed.git",
"reference": "f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7" "reference": "b753961879d0b92c284971d902355e00cad1fd9b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fguillot/picoFeed/zipball/f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7", "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/b753961879d0b92c284971d902355e00cad1fd9b",
"reference": "f39a9ec07ee73c969f1c4a7d08c9e319a7f290d7", "reference": "b753961879d0b92c284971d902355e00cad1fd9b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -295,7 +295,7 @@
"suggest": { "suggest": {
"ext-curl": "PicoFeed will use cURL if present" "ext-curl": "PicoFeed will use cURL if present"
}, },
"time": "2017-01-15 20:30:23", "time": "2017-01-16 03:10:21",
"bin": [ "bin": [
"picofeed" "picofeed"
], ],

View File

@ -30,7 +30,7 @@ class Favicon extends Base
'image/x-icon', 'image/x-icon',
'image/jpeg', 'image/jpeg',
'image/jpg', 'image/jpg',
'image/svg+xml' 'image/svg+xml',
); );
/** /**
@ -175,7 +175,7 @@ class Favicon extends Base
$dom = XmlParser::getHtmlDocument($html); $dom = XmlParser::getHtmlDocument($html);
$xpath = new DOMXpath($dom); $xpath = new DOMXpath($dom);
$elements = $xpath->query('//link[@rel="icon" or @rel="shortcut icon" or @rel="icon shortcut"]'); $elements = $xpath->query('//link[@rel="icon" or @rel="shortcut icon" or @rel="Shortcut Icon" or @rel="icon shortcut"]');
for ($i = 0; $i < $elements->length; ++$i) { for ($i = 0; $i < $elements->length; ++$i) {
$icons[] = $elements->item($i)->getAttribute('href'); $icons[] = $elements->item($i)->getAttribute('href');