3
1
Back

Elseif ($title_text && !$alt_text){ $text_element = $doc->createElement("i", $alt_text); $para_element->appendChild($alt_element); $para_element->appendChild($doc->createElement("br")); $title_element = $doc->createElement("i", $alt_text); $para_element->appendChild($alt_element); $para_element->appendChild($doc->createElement("br")); $title_element = $doc->createElement("i", $title_text); } else { return $rel; } if ($rel[0]=='#' || $rel[0]=='?') { return $this->mangle_article($article); } function mangle_article($article) { // Breaking Cat News elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { // CTRL+ALT+DEL elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { $doc = new DOMXpath($doc); $vgcats_url_node = $url_xpath->query("//a[contains(@href, 'strip_id')]")->item(0); } $article['content'] = $matches[1]; } } } return $article; } if(ADD_IDS){ $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; } if(preg_match("@.*(get_img_tags($xpath, "//div[@id='comic']/noscript/img", $article); } // Wondermark (alt tag already present) elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } 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"], "explosm.net/comics") !== FALSE) { // not a comic, just a quick and dirty content rewriting engine with code already written for about a dozen webcomics. Examples: Joy of Tech elseif (strpos($article['link'], 'cad-comic.com/cad/') !== FALSE) { //noop elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { // SatW // SatW elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { // And get blog $entries = $xpath->query($query); $result_html = ''; foreach ($entries as $entry) { $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); $article['content'] = $matches[1]; $img = $matches[1]; } } return $article; } if(ADD_IDS){ $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; // Camp Weedonwantcha elseif (strpos($article['link'], 'www.timothywinchester.com/2') !== FALSE) { // Chainsawsuit elseif (strpos($article["link"], "www.phdunknown.com/index.php?id=") !== FALSE) { From b4b4641770af206fdb9aac874d2d59b9ecc400d1.

New Pull Request