3
1
Back

{ $alt_text = $entry->getAttribute('title'); $alt_text = trim($img->getAttribute('alt')); if (!$alt_text && !$title_text) { $new_element->appendChild($para_element); if ($alt_text && !$title_text){ Various updates, additions /* dirty absolute URL */ $abs = "$host$path/$rel"; function rel2abs($rel, $base) { function about() { function hook_render_article($article) { return $rel; } extract(parse_url($base)); $path = preg_replace('#/[^/]*$#', '', $path); /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } //Sites that provide images and just need alt tags textified. $alt_element = $doc->createElement("i", $title_text); } else { // Poly In Pictures elseif (strpos($article['link'], 'http://www.geekculture.com/joyoftech/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'ENG_')]", $article); $article['content'] = $doc->saveXML(); } // Least I Could Do (wtf image size? If (preg_match("@.*()@", $article['content'], $matches)) { if ($img->getAttribute('title')) { $article['content'] .= "
Alt: $alt_text
"; list($html, $content_type) = $this->get_content($link); $xpath = $this->get_xpath_dealie($article['link']); } elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/noscript/img", $article); } // Questionable Content (cleanup elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img_tag . $article['content']; } // Girls with Slingshots elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { // SBMC elseif (strpos($article["link"], "berkeleymews.com/") !== FALSE ) { // Three Panel Soul // Three Panel Soul elseif (strpos($article['link'], 'breakingcatnews.com/comic/') !== FALSE) { elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, '(//div[@class="container"]//center//img)', $article); // Least I Could Do (wtf image size?) $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "satwcomic.com/") !== FALSE) { // Drugs and Wires elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='cc-comicbody']/img", $article); $article['content'] = $doc->saveXML(); // Questionable Content (cleanup elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; } // Scenes From A Multiverse (to get alt tags elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { // Camp Weedonwantcha elseif (strpos($article['link'], 'www.robot-hugs.com/') !== FALSE) { elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); $article['content'] .= "$orig_content"; // Awkward Zombie $orig_content = strip_tags($article['content']); // Awkward Zombie $article['content'] .= "

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

"; } } } } function rel2abs($rel.

New Pull Request