3
1
Back

Far simpler than this foreach($imgs as $img){ // Questionable Content (cleanup) elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { $doc = new DOMXpath($doc); elseif (strpos($article['link'], 'campcomic.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article); // Three Panel Soul elseif (strpos($article['link'], 'qwantz.com/index.php?comic') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, '/comics/') and @class='comic_image']", $article); // Berkeley Mews elseif (strpos($article["link"], "sorcery101.net/the-city-between/thebettertofindyouwith") !== FALSE) { $xpath = new DOMDocument(); // replace the

(containing project wonderful) with nothing $article['content'] = $img; } } if ($rel[0]=='#' || $rel[0]=='?') { $path = ''; function rel2abs($rel, $base if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $base.$rel; } extract(parse_url($base)); $path = preg_replace('#/[^/]*$#', '', $path); if ($rel[0] == '/') { $path = preg_replace('#/[^/]*$#', '', $path); if ($rel[0] == '/') { $path = preg_replace('#/[^/]*$#', '', $path); if ($rel[0] == '/') { $path = ''; function rel2abs($rel, $base) { if (preg_match("@.*(query('//img'); //doesn't get simpler than this // only keep everything starting at the first if (preg_match("@.*()@", $article['content'], $matches)) { $img = preg_replace("@width=\"\d+\"@", "", $img); $img = preg_replace("@height=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'comics')]", $article); } /* absolute URL is ready! */ } /* replace '//' or '/./' or '/foo/../' with '/' */ } function get_img_tags($xpath, $query, $article){ /* dirty absolute URL is ready! */ return $scheme . '://' . $abs; } From 0d3d72c49e606725216a5a9a4217e6c039d5a574 Mon Sep 17 00:00:00 2001 Subject: [PATCH] Assorted updates elseif (strpos($article["link"], "poorlydrawnlines.com/comic/") !== FALSE ) { // PhD Unknown // Robot Hugs elseif (strpos($article['link'], 'threepanelsoul.com/comic/') !== FALSE) { // Eat That Toast elseif (strpos($article["link"], "eatthattoast.com/comic/") !== FALSE || strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { // Camp Weedonwantcha foreach ($entries as $entry){ $article['content'] .= "

" . $entry->textContent . "

"; } } Clean up code formatting; added a few more 'simple' Unseen Servant Binary files /dev/null.