From 726eccd93d66514eca0f5b13ccbf1d8f9234113b Mon Sep 17 00:00:00 2001 From: Jeffrey Tolar Date: Fri, 12 Jul 2013 22:55:27 -0500 Subject: Try to use larger GoComics image --- plugins/af_gocomics/init.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'plugins/af_gocomics') diff --git a/plugins/af_gocomics/init.php b/plugins/af_gocomics/init.php index e95de9f14..35c535492 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"]; -- cgit v1.2.3