3
1
Back

(strpos($article["content"], "//www.vgcats.com/comics/?strip_id=") !== FALSE) { $doc = new DOMDocument(); $doc->loadHTML($html); $xpath = $this->get_xpath_dealie($article['link']); // $article['content'] = $this->get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users /* absolute URL */ $abs = "$host$path/$rel"; /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL */ /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } /* absolute URL is ready! */ return $scheme.'://'.$abs; } function mangle_article($article) { // SBMC // SBMC elseif (strpos($article["link"], "www.pilotside.us/comic/") !== FALSE) { // Three Panel Soul // Three Panel Soul // Two Lumps elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath = new DOMXPath($doc); } function hook_render_article($article) { try { return array(0.1, 'Yet more stupid-simple comic-fetching.', } function hook_render_article_cdm($article) { return $base . $rel; } if (ADD_IDS) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach.

New Pull Request