3
1
Back

Wires ttrss-plugin- _comics/init.php 264 lines define('ADD_IDS', True); define('ADD_IDS', False); define("GDORN_DEBUG", False); class _comics extends Plugin { function about() { return $rel; } if ($rel[0]=='#' || $rel[0]=='?') { return $this->mangle_article($article); } function about() { return $rel; } if ($rel[0]=='#' || $rel[0]=='?') { return $this->mangle_article($article); } function get_content($link) { * Inserts text captions from any image with an alt or title tag. Function alt_textify($article, $doc = new DOMXPath($doc); } function mangle_article($article) { // Three Panel Soul elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="post"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, '(//div[@class="post"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, '//p[@class="Maintext"]//img[contains(@src, "joyimages")]', $article); } // Three Panel Soul elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { // Invisible Bread (make the bread visible if (preg_match("@.*(get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } elseif (strpos($alt_text, $title_text) !== False) { $alt_text = trim($img->getAttribute('alt')); if (!$alt_text || strpos($article['title'], $title_text) !== false){ // there's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i", $title_text); } function get_img_tags($xpath, $query, $article, $base_url=NULL) { /* absolute URL */ $abs = "$host$path/$rel"; function rel2abs($rel, $base) { $rel = trim($rel); if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $rel; } extract(parse_url($base)); $path = preg_replace('#/[^/]*$#', '', $path); /* replace '//' or '/./' or '/foo/../' with '/' */ } function api_version() { return 2; } } if ($rel[0] == '#' || $rel[0] == '?') { return array(0.1, 'Yet more stupid-simple comic-fetching.', ' '); ' ' ); } function rel2abs($rel, $base) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = new DOMDocument(); $doc->loadHTML($html); $xpath = $this->get_xpath_dealie($article['link']); $aftercomic = $this->get_img_tags($xpath, "//img[starts-with(@src, '/comics/') and @class='comic_image']", $article); } // SBMC // SBMC elseif (strpos($article["link"], "www.pilotside.us/comic/") !== FALSE) { $xpath = $this->get_xpath_dealie($bread_page_url); $extraimage = $xpath->query("//img[@class='extrapanelimage']")->item(0); $new_element = $doc->createElement("div"); $para_element = $doc->createElement("p"); $article['content'] = $this->get_img_tags($xpath, '(//div[@id="aftercomic"]//img)', $article); $article['content'] .= $aftercomic; } } // Joy of Tech elseif (strpos($article['link'], 'campcomic.com/comic/') !== FALSE) { $article['content'] .

New Pull Request