Labels Milestones
Back20], center=true); } // Eat That Toast bog-standard example if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { // Breaking Cat News elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img; } } Dead Philosophers elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); } // Softer World (alt tags), Dinosaur Comics (alt tags+blog), CAD, attempt at OOTS (but that one fails due to referer checks Dead Philosophers Added BCN, Something Positive // Something Positive elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'uploads') and contains(@src, 'uploads') and contains(@src, 'comics')]", $article); } // Awkward Zombie elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { elseif (strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== 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='imgdiv']//img", $article); //also get the blog $entries = $xpath->query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry) { $article['content'] .= "
" . $entry->ownerDocument->saveXML($entry) . "
"; } } Invisible Bread, Softer World (alt tags), Dinosaur Comics Cleanup $entries = $xpath->query("//div[@id='comic-notes']"); foreach ($entries as $entry) { // not a comic, just a quick and dirty content rewriting engine with code already written for about a dozen webcomics. Examples: * Least I Could Do (wtf image size? Elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comic-wrap']//img[@class='comic']", $article); // } elseif (strpos($alt_text, $title_text) !== false){ $text_element = $doc->createElement("i", $title_text); $para_element->appendChild($title_element); } $img->parentNode->replaceChild($new_element, $img); } function rel2abs($rel, $base) { if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'ENG_')]", $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("@.*(