mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-19 02:11:30 +00:00
Try to use larger GoComics image
This commit is contained in:
committed by
Andrew Dolgov
parent
fde0b96f6d
commit
726eccd93d
@@ -32,7 +32,7 @@ class Af_GoComics extends Plugin {
|
|||||||
|
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
|
|
||||||
if (preg_match("/(http:\/\/assets.amuniversal.com\/.*)/i", $entry->getAttribute("src"), $matches)) {
|
if (preg_match("/(http:\/\/assets.amuniversal.com\/.*width.*)/i", $entry->getAttribute("src"), $matches)) {
|
||||||
|
|
||||||
$entry->setAttribute("src", $matches[0]);
|
$entry->setAttribute("src", $matches[0]);
|
||||||
$basenode = $entry;
|
$basenode = $entry;
|
||||||
@@ -40,6 +40,19 @@ class Af_GoComics extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$basenode) {
|
||||||
|
// fallback on the smaller version
|
||||||
|
foreach ($entries as $entry) {
|
||||||
|
|
||||||
|
if (preg_match("/(http:\/\/assets.amuniversal.com\/.*)/i", $entry->getAttribute("src"), $matches)) {
|
||||||
|
|
||||||
|
$entry->setAttribute("src", $matches[0]);
|
||||||
|
$basenode = $entry;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($basenode) {
|
if ($basenode) {
|
||||||
$article["content"] = $doc->saveXML($basenode);
|
$article["content"] = $doc->saveXML($basenode);
|
||||||
$article["plugin_data"] = "gocomics,$owner_uid:" . $article["plugin_data"];
|
$article["plugin_data"] = "gocomics,$owner_uid:" . $article["plugin_data"];
|
||||||
|
|||||||
Reference in New Issue
Block a user