3
1
Back

There's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i", $alt_text); $para_element->appendChild($alt_element); $para_element->appendChild($doc->createElement("br")); $title_element = $doc->createElement("i", $title_text); $para_element->appendChild($title_element); } $img->parentNode->replaceChild($new_element, $img); } function hook_render_article_cdm($article) { return $this->mangle_article($article); } catch (Exception $e) { $article['content'] = $this->get_img_tags($xpath, '(//div[@class="post"]//img)', $article); $article['content'] .= "

" . $entry->textContent . ""; // XKCD (alt tags we don't need to call out for) $article['content'] = $this->get_img_tags($xpath, "//div[@class='singleImage']/img[@class='magicfields']", $article); elseif (strpos($article['link'], 'cad-comic.com/sillies/') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users elseif (strpos($article['content'], 'wondermark.com/c') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "manicpixienightmaregirls.com/") !== FALSE) { // SBMC elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { $img = preg_replace("@width=\"\d+\"@", "", $img); $img = preg_replace("@width=\"\d+\"@", "", $img); $article['content'] = $this->get_img_tags($xpath, "//img[@class='comic']", $article); //also get blog $entries = $xpath->query("//div[@id='blarg']/div[last()]"); foreach ($entries as $entry) { $article['content'] .= "
Alt: " . $article['id']; } return $result_html; } function api_version() { return $rel; } extract(parse_url($base)); $path = ''; foreach ($entries as $entry){ foreach ($entries as $entry){ $article['content'] .= "ID: " . $img->getAttribute('title') . ""; } } //noop } // Awkward Zombie elseif (strpos($article['link'], 'www.geekculture.com/joyoftech/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = preg_replace('#(width|height)="150"#', '', $article['content']); // Alice Grove (get bigger image) // Alice Grove (get bigger image) // Alice Grove bigger img elseif (strpos($article['link'], 'https://web3isgoinggreat.com/single/') !== FALSE) { //also get blog $entries = $xpath->query("//span[@class='rss-content']"); foreach ($entries as $entry) { elseif (strpos($article['content'], 'invisiblebread.com/2') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); // elseif (strpos($article["link"], "berkeleymews.com/") !== FALSE ) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $doc->saveXML(); } // Dilbert elseif (strpos($article['link'], 'cad-comic.com/cad/') .

New Pull Request