3
1
Back

*/ /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } //Sites that provide images and just need alt tags in feedburner (if there are quotes) // Doghouse Diaries, which has broken alt tags textified. Elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { // Awkward Zombie elseif (strpos($article['link'], 'somethingpositive.net') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, '/comics/') and @class='comic_image']", $article); } // Timothy Winchester (People I Know) elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img; } } // Three Panel Soul elseif (strpos($article['link'], 'www.timothywinchester.com/2') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'comics')]", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users if (preg_match("@.*(query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry) { $article['content'] = $this->get_img_tags($xpath, "//div[@class='img-comic-container']//img", $article); } Some comics supported elseif (strpos($article['link'], 'threepanelsoul.com/2') !== FALSE) { $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, '(//div[@class="container"]//center//img)', $article); // The Trenches elseif (strpos($article["link"], "trenchescomic.com/comic/post/") !== FALSE || strpos($article['content'], 'thedoghousediaries.com/dhdcomics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); // Berkeley Mews elseif (strpos($article["link"], "www.pilotside.us/comic/") !== FALSE) { $xpath.

New Pull Request