3
1
Back

$orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); } // Least I Could Do (wtf image size? If(preg_match("@.*()@", $article['content'], $matches)){ $img = preg_replace("@width=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); $article['content'] .= "

" . $entry->ownerDocument->saveXML($entry) . "

"; } } if (ADD_IDS) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { if (strpos($article["content"], "bonus panel!") !== FALSE) { elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE || strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { $article['content'] .= $aftercomic; } } if(ADD_IDS){ $article['content'] .= "$orig_content"; // Awkward Zombie elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="aftercomic"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, "//div[@class='timeline-description']", $article); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-img']//img", $article); $alt_text = trim($img->getAttribute('alt')); if (!$alt_text || $alt_text == $article['title'] || strpos($article['title'], $title_text) !== false){ // there's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i", $alt_text); $para_element->appendChild($text_element); } elseif ($title_text && !$alt_text){ $text_element = $doc->createElement("i", $title_text); } function get_xpath_dealie($link){ list($html, $content_type) = $this->get_content($link); $xpath = $this->get_xpath_dealie($article['link']); Updated LICD, alter alt-textify to handle both title and alt tags elseif (strpos($article['link'], 'www.geekculture.com/joyoftech/') !== FALSE) { elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'Strip')]", $article); $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users /* absolute URL is ready! */ elseif (strpos(strtolower($article['link']), 'giantitp.com/comics/') !== FALSE) { $aftercomic = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); function mangle_article($article) { // CTRL+ALT+DEL elseif (strpos($article['link'], 'http://www.geekculture.com/joyoftech/') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // draw panel, subtract holes // v_wall(h=4, l=height-rail_clearance*2-thickness); // top point? // Pain Train alt tag, Alice Grove bigger img Pain Train (to get alt tag) elseif (strpos($article['link'], 'www.geekculture.com/joyoftech/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } // $article['content'] = $img_tag . $article['content']; } // Eat That Toast elseif (strpos($article["link"], "poorlydrawnlines.com/comic/") !== FALSE ) { // Camp Weedonwantcha elseif (strpos($article['link'], 'dead-philosophers.com/?p') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Dilbert elseif (strpos($article['link'], 'threepanelsoul.com/comic/') !== FALSE) { $doc = new DOMXpath($doc); elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content.

New Pull Request