3
1
Back

20mm in diameter at the first // only keep everything starting at the first elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { // Eat That Toast bog-standard example // Breaking Cat News elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { // not a comic, just a quick and dirty content rewriting engine with code already written for about a dozen webcomics. Examples: Joy of Tech elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { elseif (strpos($article['link'], 'alicegrove.com') !== FALSE) { elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { //noop elseif (strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users $entries = $xpath->query($query); $result_html = ''; function get_xpath_dealie($link) { $abs = "$host$path/$rel"; /* 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 elseif (strpos($article['link'], 'gunnerkrigg.com/?p') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); } // Awkward Zombie // Awkward Zombie elseif (strpos($article['link'], 'www.geekculture.com/joyoftech/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $doc->saveHTML(); elseif (strpos($article['link'], 'paintraincomic.com/comic/') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[@class='comic']", $article); //also get blog entry $entries = $xpath->query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry) { // CTRL+ALT+DEL // CTRL+ALT+DEL Sillies elseif (strpos($article['link'], 'paintraincomic.com/comic/') !== FALSE) { .

New Pull Request