3
1
Back

'http://www.achewood.com/index.php?date=') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='cc-comicbody']//img", $article); } elseif ($alt_text == $article['title'] || strpos($article['title'], $title_text) !== False) { if ($img->getAttribute('title')) { $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); } // Cyanide & Happiness elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $img_tag = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'png')]", $article); } /* dirty absolute URL */ $abs = "$host$path/$rel"; /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array( '#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#' ); for ($n = 1; $n > 0; $abs = preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL */ /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } // Cyanide & Happiness // Cyanide & Happiness elseif (strpos(strtolower($article['link']), 'giantitp.com/comics/') !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ $article['content'] .= "

$orig_content

"; //also append the blarg post because that's small, interesting, //and.

New Pull Request