3
1
Back

Simple. Follow one pattern. Class _comics extends Plugin { 'Yet more stupid-simple comic-fetching.', ' ' ); } function mangle_article($article) { if (strpos($article["content"], "bonus panel!") !== FALSE) { // Timothy Winchester (People I Know elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img; } //Sites that provide images and just need alt tags textified. //Sites that provide images and just need alt tags textified. Elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, '/comics/') and @class='comic_image']", $article); // Dead Philosophers $doc->loadHTML($article['content']); // Dinosaur Comics (alt tags+blog), CAD, attempt at OOTS (but that one fails due to referer checks elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ $article['content'] .= "

" . $entry->ownerDocument->saveXML($entry) . "

"; elseif (strpos($article["link"], "drugsandwires.fail/dnwcomic/") !== FALSE) { // Girls with Slingshots elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(/[0-9-]+)-150x150\.gif#', '$1.gif', $article['content']); $article['content'] = $doc->saveXML(); } // CTRL+ALT+DEL elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $img_tag = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users if (preg_match("@.*( New Pull Request