summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJeffrey Tolar <[email protected]>2013-07-12 22:55:27 -0500
committerAndrew Dolgov <[email protected]>2013-07-14 11:27:44 +0400
commit726eccd93d66514eca0f5b13ccbf1d8f9234113b (patch)
tree258fab807907c49534f1fd69d540b3c25eec9fd7 /plugins
parentfde0b96f6d57af1f6e6f7304388b3b8ab7173427 (diff)
Try to use larger GoComics image
Diffstat (limited to 'plugins')
-rw-r--r--plugins/af_gocomics/init.php15
1 files changed, 14 insertions, 1 deletions
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"];