3
1
Back

= 10.16; // If you want to dig into the linked page for content, e.g. Alt tags. */ global $fetch_last_content_type; $html = fetch_file_contents($link); $content_type = $fetch_last_content_type; return array( $html, $content_type ); } function get_content($link) { $html = fetch_file_contents($link); $content_type = $fetch_last_content_type; function rel2abs($rel, $base $path = ''; } /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } if (ADD_IDS) { $article['content'] = $this->get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } Gunnerkrigg and cleanup of alt-tag-only sites elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { //also append the blarg post because that's small, interesting, } //and sometimes necessary for old fogeys like me to get what game it's about $article['content'] .= "
ID: " . $img->getAttribute('title') . ""; } } // Three Panel Soul elseif (strpos($article['link'], 'wondermark.com/c') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-1']//img", $article); } // Girls with Slingshots // Girls with Slingshots // Girls with Slingshots $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } // Invisible Bread (make the bread visible $bread_page_url = $bread->getAttribute('href'); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='img-comic-container']//img", $article); // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img; } } } if(ADD_IDS){ $article['content'] .= "

" . $entry->textContent . "

"; $article['content'] .= "
Alt: " . $img->getAttribute('title') . ""; // Softer World (alt tags), Dinosaur Comics Cleanup $extraimage = $xpath->query("//img[@class='extrapanelimage']")->item(0); $new_element = $doc->createElement("img"); $new_element->setAttribute('src', $extraimage->getAttribute('src')); $bread->parentNode->replaceChild($new_element, $bread); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article); } // XKCD (alt tags we don't need.