3
1
Back

Important: Keep it simple. Follow one pattern. Class _comics extends Plugin { function api_version() { $re = array( '#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#' ); for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) { } /* dirty absolute URL is ready! */ Assorted updates elseif (strpos($article['link'], 'cad-comic.com/comic/') !== FALSE) { $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; $img_tag = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Least I Could Do (wtf image size? If (preg_match("@.*()@", $article['content'], $matches)) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'ENG_')]", $article); } // Pain Train alt tag, Alice Grove bigger img elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="post"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Dead Philosophers Dead Philosophers elseif (strpos($article['link'], 'awkwardzombie.com/index.php?comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Wondermark (alt tag already present) // Wondermark (alt tag already present foreach ($imgs as $img) { $article['content'] .= "
Alt: " . $img->getAttribute('title') . ""; // Camp Weedonwantcha elseif (strpos($article['link'], 'cad-comic.com/cad/') !== FALSE) { // Three Panel Soul $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $doc->saveXML(); } // Gunnerkrigg Court // Gunnerkrigg Court elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { // Robot Hugs $entries = $xpath->query("//div[@id='blarg']/div[last()]"); // Scenes From A Multiverse (to get alt tags textified. $doc->loadHTML($article['content']); //no-op $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach.

New Pull Request