3
1
Back

{ $rel = trim($rel); if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $rel; } if (ADD_IDS) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ // Questionable Content (cleanup) elseif (strpos($article['link'], 'dilbert.com/strip/') !== FALSE) { elseif (strpos($article['link'], 'girlswithslingshots.com/comic/') !== FALSE) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'comics')]", $article); } achewood, gwss fix, fix for when invisiblebread has no bread Fix for when invisible bread has no bread $article['content'] = $this->get_img_tags($xpath, '(//div[@id="aftercomic"]//img)', $article); $article['content'] = $this->get_img_tags($xpath, "//img[@class='ksc' and contains(@src, 'uploads') and contains(@src, 'uploads') and contains(@src, 'png')]", $article); elseif (strpos($article['link'], 'gunnerkrigg.com/?p') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Wondermark (alt tag already present) elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'png')]", $article); } // Something Positive elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']/img", $article); $article['content'] .= "" . $entry->textContent . "

"; } } // Invisible Bread (make the bread visible elseif (strpos($article['content'], 'www.asofterworld.com/index.php?id') !== FALSE) { // Something Positive if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img_tag . $article['content']; // $article['content'] = $this->get_img_tags($xpath, "//div[@class='singleImage']/img[@class='magicfields']", $article); elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $xpath = new DOMXpath($doc); $imgs = $xpath->query('//img'); //doesn't get simpler than this } //No matches if ($img->getAttribute('title')) { $article['content'] .= "
Alt: " . $article['id']; } return $result_html; } function get_img_tags($xpath, $query, $article){ $entries = $xpath->query("//div[@id='signoff-wrapper']"); } //Sites that provide images and just need alt tags textified. } //Sites that provide images and just need alt tags if both exist achewood, gwss fix, fix for when invisible bread has no bread Pain Train alt.

New Pull Request