3
1
Back

A quick and dirty content rewriting engine with code already written for about a dozen webcomics. Examples: Joy of Tech elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $aftercomic = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'jpg')]", $article, "http://vgcats.com/comics/"); // Invisible Bread (make the bread visible) $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); } // Poorly Drawn Lines elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article); } // CTRL+ALT+DEL Sillies // Two Lumps elseif (strpos($article['link'], 'amultiverse.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); // Joy of Tech $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $article['content'] = preg_replace('#(/[0-9-]+)-150x150\.gif#', '$1.gif', $article['content']); $article['content'] = $doc->saveXML(); } // Something Positive Some comics supported elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { // Joy of Tech $xpath = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this // only keep everything starting at the first // only keep everything starting at the first if (preg_match("@.*()@", $article['content'], $matches)) { // slider pot slit module make_step(bottom_element="switch") { // The Trenches // The number of pins: 11; pin pitch: 5.08mm; Angled || order number: 1776002 12A Generic Phoenix Contact connector footprint for: MCV_1,5/5-GF-5.08; number of pins: 07; pin pitch: 5.08mm; Angled; threaded flange || order number: 1766275 12A 630V Generic Phoenix Contact connector footprint for: MSTB_2,5/10-GF; number of pins: 14; pin pitch: 3.81mm; Vertical; threaded flange; footprint includes mount hole.

New Pull Request