3
1
Back

Alt tag elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '//td/img[contains(@src, "/comics/images/")]', $article); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Scenes From A Multiverse (to get alt tags foreach($imgs as $img){ foreach ($imgs as $img) { if (preg_match("@.*?(.*)@", $article['content'], $matches)) { $img = preg_replace("@width=\"\d+\"@", "", $img); $img = preg_replace("@height=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, '//td/img[contains(@src, "/comics/images/")]', $article); } // CTRL+ALT+DEL elseif (strpos($article['link'], 'alicegrove.com') !== FALSE) { // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } // PhD Unknown // Robot Hugs $entries = $xpath->query("//span[@class='rss-content']"); foreach ($entries as $entry){ $article['content'] .= "
Alt: $alt_text
"; list($html, $content_type) = $this->get_content($link); $doc = new DOMXPath($doc); return $xpath; } function get_img_tags($xpath, $query, &$article, $base_url=NULL) { /* absolute URL */ $abs = "$host$path/$rel"; function rel2abs($rel, $base) { function get_img_tags($xpath, $query, $article){ $new_src = $this->rel2abs($orig_src, $article['link']); $entry->setAttribute('src', $new_src); $result_html .= $entry->ownerDocument->saveXML($entry); Added BCN, Something Positive $alt_text = $entry->getAttribute('alt'); $alt_text = trim($img->getAttribute('title')); if (!$alt_text) { $new_element = $doc->createElement("img"); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="comic"]//img)', $article) . $article['content']; } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "www.phdunknown.com/index.php?id=") !== FALSE) { // Something Positive Some comics supported elseif (strpos($article['link'], 'breakingcatnews.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($bread_page_url); $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, '//td/img[contains(@src, "/comics/images/")]', $article); } elseif (strpos($title_text, $alt_text) !== false){ // there's both alt and.

New Pull Request