3
1
Back

With code already written for about a dozen webcomics. Examples: * Least I Could Do (wtf image size?) $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='img-comic-container']//img", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text //also get the blog $entries = $xpath->query("//span[@class='rss-content']"); foreach ($entries as $entry) { $article['content'] .= "
Alt: $alt_text
"; list($html, $content_type) = $this->get_content($link); $doc = new DOMXpath($doc); elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'png')]", $article); } // Invisible Bread (make the bread visible) elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE ) { $img_tag = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'png')]", $article); elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ if ($img->getAttribute('title')) { // Dilbert elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { //no-op function rel2abs($rel, $base) { if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $base . $rel; for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) { } /* absolute URL is ready! */ return $scheme.'://'.$abs; } function get_img_tags($xpath, $query, $article){ $new_src = $this->rel2abs($orig_src, $base_url); foreach($attributes as $attrib_name => $node){ } function api_version() { return array(0.1, 'Yet more stupid-simple comic-fetching.', .

New Pull Request