3
1
Back

A quick and dirty content rewriting engine with code already written for about a dozen webcomics. Examples: * Least I Could Do (wtf image size? If (preg_match("@.*()@", $article['content'], $matches)) { } /* OotS uses some kind of referer check which prevents the browser from getting the image. // $article['content'] = $this->get_img_tags($xpath, "//div[@id='comicbody']//img", $article); elseif (strpos($article["link"], "manicpixienightmaregirls.com/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Least I Could Do (wtf image size? If(preg_match("@.*()@", $article['content'], $matches)){ $img = preg_replace("@width=\"\d+\"@", "", $img); $img = preg_replace("@width=\"\d+\"@", "", $img); $img = preg_replace("@height=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); $article['content'] = $doc->saveXML(); // Questionable Content (cleanup) $article['content'] .= "

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

"; } } return $result_html; } function hook_render_article_cdm($article) { return $rel; } if ($rel[0] == '/') { $path = ''; function rel2abs($rel, $base) { function get_img_tags($xpath, $query, $article, $base_url=NULL) { $img_attributes_whitelist = array('src', 'alt', 'title'); $new_src = $this->rel2abs($orig_src, $article['link']); if ($alt_text && !$title_text){ $text_element = $doc->createElement("i", $alt_text); $para_element->appendChild($alt_element); $para_element->appendChild($doc->createElement("br")); $title_element = $doc->createElement("i", $title_text); } elseif (strpos($title_text, $alt_text) !== false){ } elseif (strpos($title_text, $alt_text) !== false){ $text_element = $doc->createElement("i", $title_text); } else if (two_holes_type == "opposite") { } //Sites that provide images and just need alt tags textified. } //Sites that provide images and just need alt tags if both exist achewood, gwss fix, fix for when invisible bread has no bread $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } */ .

New Pull Request