3
1
Back

DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ if ($img->getAttribute('title')) { $article['content'] .= "

" . $entry->textContent . "

"; } } // Breaking Cat News elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { main MK_VCO/Fireball/Fireball.kicad_sch 6400 lines Latest commits for file Panels/luther_triangle_10hp.scad Fix for two bugs in Doghouse Diaries rss: spaces in img src and quotes in alt/title text under images (extra useful for non-browser users) function about() { return $base.$rel; } extract(parse_url($base)); $path = ''; function get_xpath_dealie($link) { $abs = preg_replace($re, '/', $abs, -1, $n)) {} /* 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)) { } function get_img_tags($xpath, $query, $article){ /* dirty absolute URL is ready! */ return $scheme.'://'.$abs; } function rel2abs($rel, $base) { if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); // only keep everything starting at the bottom.

New Pull Request