3
1
Back

Keep it simple. Follow one pattern. Class _comics extends Plugin { function about() { return array(0.1, 'Yet more stupid-simple comic-fetching.', } function get_img_tags($xpath, $query, $article, $base_url=NULL) { /* absolute URL is ready! */ return $scheme . '://' . $abs; if (preg_match("@.*(get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); } // Eat That Toast bog-standard example if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { Gunnerkrigg and cleanup of alt-tag-only sites Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { // CTRL+ALT+DEL // CTRL+ALT+DEL Sillies // Two Lumps $orig_content = strip_tags($article['content']); $article['content'] = $matches[1]; $img = preg_replace("@width=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comicbody']//img", $article); elseif (strpos($article['link'], 'alicegrove.com') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article) . $article['content']; } // Chainsawsuit elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { // Breaking Cat News elseif (strpos($article['link'], 'gunnerkrigg.com/?p') !== FALSE) { // Dilbert.

New Pull Request