From 726eccd93d66514eca0f5b13ccbf1d8f9234113b Mon Sep 17 00:00:00 2001 From: Jeffrey Tolar Date: Fri, 12 Jul 2013 22:55:27 -0500 Subject: [PATCH] Try to use larger GoComics image --- plugins/af_gocomics/init.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/af_gocomics/init.php b/plugins/af_gocomics/init.php index e95de9f1..35c53549 100644 --- a/plugins/af_gocomics/init.php +++ b/plugins/af_gocomics/init.php @@ -32,7 +32,7 @@ class Af_GoComics extends Plugin { 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]); $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) { $article["content"] = $doc->saveXML($basenode); $article["plugin_data"] = "gocomics,$owner_uid:" . $article["plugin_data"]; -- 2.39.5