3
1
Back

$imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ if ($img->getAttribute('title')) { $article['content'] .= "Error processing via _comics plugin!
" . $e->getMessage(); if (strpos($article["link"], "penny-arcade.com") !== FALSE || strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE){ //also get blog $entries = $xpath->query("//div[@class='entry']"); foreach ($entries as $entry){ foreach ($entries as $entry) { $article['content'] = $this->get_img_tags($xpath, '(//div[@id="aftercomic"]//img)', $article); $article['content'] .= "" . $msg . ""; } } // Joy of Tech $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); // Dead Philosophers 2015-02-25 15:05:54 -08:00 // Eat That Toast elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, '(//div[@id="main"]//img)', $article); elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { elseif (strpos($article['link'], 'cad-comic.com/cad/') !== FALSE) { $xpath = $this->get_xpath_dealie($bread_page_url); $extraimage = $xpath->query("//img[@class='extrapanelimage']")->item(0); $new_element = $doc->createElement("img"); $new_element->setAttribute('src', $extraimage->getAttribute('src')); $bread->parentNode->replaceChild($new_element, $bread); $article['content'] = preg_replace("@@", '', $article['content']); // Penny Arcade if (strpos($article["link"], "penny-arcade.com") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comicbody']//img", $article); } // Scenes From A Multiverse (to get alt tag) elseif (strpos($article['link'], 'www.geekculture.com/joyoftech/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); Invisible Bread, Softer World (alt tags), Dinosaur Comics Cleanup elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'comics')]", $article); } // Timothy Winchester (People I Know) elseif (strpos($article['link'], 'dead-philosophers.com/?p') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'png')]", $article); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'uploads') and contains(@src, 'comics')]", $article); } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "satwcomic.com/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); } // Least I Could Do (wtf image size?) elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath .

New Pull Request