3
1
Back

-08:00 } $article = $this->alt_textify($article); if (ADD_IDS) { $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); } // XKCD (alt tags we don't need to call out for if(preg_match("@.*()@", $article['content'], $matches)){ $img = $matches[1]; $img = $matches[1]; $img = preg_replace("@height=\"\d+\"@", "", $img); $img = $matches[1]; } } } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users $entries = $xpath->query("//div[@id='signoff-wrapper']"); foreach ($entries as $entry){ foreach ($entries as $entry) { $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); } // XKCD (alt tags we don't need to call out for) elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { //No matches //No matches if ($img->getAttribute('title')) { $article['content'] = $this->get_img_tags($xpath, '//td/img[contains(@src, "/comics/images/")]', $article); // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); } // Cyanide & Happiness elseif (strpos($article["link"], "eatthattoast.com/comic/") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='timeline-description']", $article); $article['content'] = $this->get_img_tags($xpath, "//div[@id='imgdiv']//img", $article); //also get the blog //also get blog entry $entries = $xpath->query("//span[@class='rss-content']"); foreach ($entries as $entry){ $article['content'] .= "

" . $entry->textContent . "

"; } } .

New Pull Request