3
1
Back

Lit for each author's protection and ours, we want $url_xpath = 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']); $article['content'] = $this->get_img_tags($xpath, '(//img[@id="main-comic"])', $article); } // Least I Could Do (wtf image size?) $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); // Joy of Tech elseif (strpos($article['link'], 'threepanelsoul.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; } } foreach($imgs as $img){ // Softer World (alt tags), Dinosaur Comics (alt tags+blog), CAD, attempt at OOTS (but that one fails due to referer checks elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { elseif (strpos($article['link'], 'gunnerkrigg.com/?p') !== FALSE) { elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[@class='comic']", $article); //also get blog //also get the blog $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//img", $article); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-img']//img", $article); } // Three Panel Soul elseif (strpos($article['link'], 'http://www.achewood.com/index.php?date=') !== FALSE) { // Eat That Toast bog-standard example elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { // Dilbert elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); elseif (strpos($article['link'], 'awkwardzombie.com/index.php?comic') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article); } // Wondermark (alt tag elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE.

New Pull Request