3
1
Back

'' || substr($rel, 0, 2) == '//') { return $article; } function api_version() { return $base . $rel; } extract(parse_url($base)); $path = ''; function get_xpath_dealie($link) { $abs = preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL is ready! */ return $scheme . '://' . $abs; if (preg_match("@.*("; } } 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'], 'qwantz.com/index.php?comic') !== FALSE) { // Dead Philosophers elseif (strpos($article['link'], 'awkwardzombie.com/index.php?comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); } Some comics supported Some comics supported elseif (strpos($article['link'], 'www.timothywinchester.com/2') !== FALSE) { $article['content'] = $img; } } // PhD Unknown elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Wondermark (alt tag already present elseif (strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { // Camp Weedonwantcha elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { //noop elseif (strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE){ //also get blog $entries = $xpath->query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry){ foreach ($entries as $entry) { $article['content'] .= "Error processing via _comics plugin!
" . $e->getMessage(); } } if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { $doc = new DOMDocument(); elseif (strpos($article['link'], 'paintraincomic.com/comic/') !== FALSE) { $article['content'] .= "
Error processing via _comics plugin!" . $e->getMessage(); } } // Cyanide & Happiness elseif (strpos($article["link"], "drugsandwires.fail/dnwcomic/") !== FALSE) { // Dead Philosophers elseif (strpos($article['link'], 'dead-philosophers.com/?p') !== FALSE) { elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); // $img_tag = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // CTRL+ALT+DEL elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { $aftercomic = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); $article['content'] = $matches[1]; $img = $matches[1]; $img = preg_replace("@height=\"\d+\"@", "", $img); $article['content.

New Pull Request