3
1
Back

.= "

" . $entry->textContent . "

"; } } $entries = $xpath->query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry) { $article['content'] .= "
Alt: $alt_text
"; } } // SBMC elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $xpath = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, "//img[contains(@src, 'sp') and contains(@src, 'png')]", $article); elseif (strpos($article['link'], 'cad-comic.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); } // Chainsawsuit // Chainsawsuit // Chainsawsuit elseif (strpos($article["link"], "eatthattoast.com/comic/") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); $article['content'] = $img_tag . $article['content']; } // Awkward Zombie elseif (strpos($article['link'], '//theoatmeal.com/comics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='imgdiv']//img", $article); // Three Panel Soul elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $aftercomic = $this->get_img_tags($xpath, '(//div[@id="comicFrame"])', $article); } Some comics supported Some comics supported elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { $doc = new DOMXpath($doc); $bread = $xpath->query("//a[contains(@href, 'bonus-panel')]")->item(0); $bread_page_url = $bread->getAttribute('href'); $xpath = $this->get_xpath_dealie($article['link']); // Three Panel Soul * Scenes From A Multiverse (to get alt tags textified. Elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-img']//img", $article); $alt_text = trim($entry->getAttribute('title')); $result_html .= "
Alt: " . $img->getAttribute('title') . ""; } } //Sites that provide images and just need alt tags textified. Elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { // Chainsawsuit // Chainsawsuit elseif (strpos($article["link"], "trenchescomic.com/comic/post/") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace("@@", '', $article['content']); // only keep everything.

New Pull Request