3
1
Back

The first if(preg_match("@.*()@", $article['content'], $matches)){ if (preg_match("@.*( foreach($imgs as $img){ foreach ($imgs as $img) { if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $base.$rel; } extract(parse_url($base)); $path = ''; $orig_src = $entry->getAttribute('src'); $new_src = $this->rel2abs($orig_src, $article['link']); $entry->setAttribute('src', $new_src); $result_html .= "
Alt: " . $article['id']; } return $article; } function get_img_tags($xpath, $query, $article, $base_url=NULL) { /* absolute URL is ready! */ return $scheme . '://' . $abs; if (preg_match("@.*(get_img_tags($xpath, "//div[@id='content']/img", $article); $article['content'] = $img_tag . $article['content']; } Added The Trenches; yet more code style tweaking elseif (strpos(strtolower($article['link']), 'giantitp.com/comics/') !== FALSE) { //noop elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { // only keep everything starting at the first if (preg_match("@.*()@", $article['content'], $matches)) { $img = $matches[1]; $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'ENG_')]", $article); $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 // $article['content'] = $this->get_img_tags($xpath, '(//div[@class="post"]//img)', $article); // Least I Could Do (wtf image size? If (preg_match("@.*()@", $article['content'], $matches)) { if (!$alt_text || $alt_text == $article['title'] || strpos($article['title'], $alt_text) !== False) { $alt_text .

New Pull Request