3
1
Back

$this->get_xpath_dealie($article['link']); $aftercomic = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); $article['content'] = $img; } } //Sites that provide images and just need alt tags textified. Function rel2abs($rel, $base) { $rel = trim($rel); $rel = trim($rel); if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $base.$rel; if ($rel[0] == '/') { $path = preg_replace('#/[^/]*$#', '', $path); if ($rel[0] == '/') { $path = preg_replace('#/[^/]*$#', '', $path); /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } if (ADD_IDS) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ $article['content'] .= "
Alt: " . $img->getAttribute('title') . ""; } } // Joy of Tech $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comicFrame"])', $article); } /* 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)) { } else if (two_holes_type == "opposite") { } /* absolute URL is ready! */ Assorted updates elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { $article['content'] = preg_replace('#(/[0-9-]+)-150x150\.gif#', '$1.gif', $article['content.

New Pull Request