Labels Milestones
Back'(//div[@id="comic"]//img)', $article) . $article['content']; } // Dilbert // Dilbert elseif (strpos($article['link'], 'cad-comic.com/comic/') !== FALSE) { // Poorly Drawn Lines // Berkeley Mews elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { $article['content'] .= $aftercomic; } } if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { $xpath = new DOMDocument(); elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE || strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE){ $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } // Poorly Drawn Lines // Berkeley Mews // elseif (strpos($article["link"], "www.phdunknown.com/index.php?id=") !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article) . $article['content']; elseif (strpos($article["link"], "trenchescomic.com/comic/post/") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); // Dead Philosophers elseif (strpos($article['link'], 'cad-comic.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[contains(@src, 'sp') and contains(@src, 'png')]", $article); elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { $article['content'] .= "
Alt: $alt_text"; } } // Three Panel Soul elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-img']//img", $article); } */ // Girls with Slingshots elseif (strpos($article['link'], 'awkwardzombie.com/index.php?comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(/[0-9-]+)-150x150\.gif#', '$1.gif', $article['content']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="main"]//img)', $article); elseif (strpos($article["link"], "trenchescomic.com/comic/post/") !== FALSE ) { // Invisible Bread (make the bread visible) elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { if ($doc === NULL) { foreach ($article['debugging'] as $msg) { $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); } // Questionable Content (cleanup) // Questionable Content (cleanup) $article['content'] .= "Bonus comic:" . $aftercomic . "
Alt: " . $article['id']; } return $article; } function get_img_tags($xpath, $query, $article) { function get_img_tags($xpath, $query, $article){ $new_src = $this->rel2abs($orig_src, $base_url); foreach($attributes as $attrib_name => $node){ } function mangle_article($article) { if (preg_match("@.*?(