3
1
Back

$html, $content_type ); } function mangle_article($article) { // 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 (strpos($title_text, $alt_text) !== false){ // there's both alt and title texts, they're both different, use both. $title_element = $doc->createElement("i", $alt_text); $para_element->appendChild($text_element); } elseif (strpos($alt_text, $title_text) !== false){ // there's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i", $title_text); } elseif (strpos($alt_text, $title_text) !== False) { if ($img->getAttribute('title')) { $article['content'] .= "

" . $entry->textContent . "

"; } } foreach($imgs as $img){ if ($img->getAttribute('title')) { $article['content'] .= "

" . $entry->ownerDocument->saveXML($entry) . ""; if (ADD_IDS) { $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); } // Questionable Content (cleanup) // Questionable Content (cleanup) elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { // Wondermark (alt tag already present elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; // only keep everything starting at the first elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { //noop elseif (strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { $article['content'] = $matches[1]; $img = preg_replace("@width=\"\d+\"@", "", $img); $img = $matches[1]; // Least I Could Do (wtf image size? Elseif (strpos($article['link'], 'awkwardzombie.com/index.php?comic') !== FALSE) { elseif (strpos($article['link'], 'threepanelsoul.com/2') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//figure[@class='photo-hires-item']//img", $article); } // Poorly Drawn Lines elseif (strpos($article["link"], "www.phdunknown.com/index.php?id=") !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'png')]", $article); } // Invisible Bread (make the bread visible) // Invisible Bread (make the bread visible $bread_page_url = $bread->getAttribute('href'); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace("@@", '', $article['content']); // Alice Grove (get bigger image // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comic-wrap']", $article); //Sites that provide images and just need alt tags in feedburner (if there are quotes elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); elseif (strpos($article["link"], "eatthattoast.com/comic/") !== FALSE ) { // Invisible Bread (make the bread visible) elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { $article['content'] .= "

" . $entry->textContent . "

"; } .

New Pull Request