3
1
Back

Rewriting engine with code already written for about a dozen webcomics. Examples: * Least I Could Do (wtf image size? Elseif (strpos($article['link'], 'amultiverse.com/comic/') !== FALSE) { // Two Lumps // Two Lumps elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { // Dead Philosophers elseif (strpos($article['link'], 'questionablecontent') !== FALSE) { // Eat That Toast elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { // Dead Philosophers elseif (strpos($article['link'], 'amultiverse.com/comic/') !== FALSE) { elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { $xpath = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ // Softer World (alt tags), Dinosaur Comics Cleanup elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { // And get blog $entries = $xpath->query("//div[@id='signoff-wrapper']"); foreach ($entries as $entry){ $orig_src = $entry->getAttribute('src'); $new_src = $this->rel2abs($orig_src, $base_url); foreach($attributes as $attrib_name => $node){ } 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; // [0:No, 1:Yes] // 0 if indicator faces notch, 180 if it faces away and so on.

New Pull Request