3
1
Back

First foreach($imgs as $img){ if ($img->getAttribute('title')) { $article['content'] .= "
Alt: " . $article['id']; $article = $this->alt_textify($article); if (GDORN_DEBUG && $article['debugging']) { foreach ($imgs as $img) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $orig_content = strip_tags($article['content']); $article['content'] = $this->get_img_tags($xpath, "//img[starts-with(@src, 'sp') and contains(@src, 'comics')]", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users) 2015-03-02 17:38:43 -08:00 } $article = $this->alt_textify($article); if (ADD_IDS) { $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Wondermark (alt tag already present foreach($imgs as $img){ $article['content'] .= "

" . $entry->textContent . "

"; } } // Joy of Tech Scenes From A Multiverse (to get alt tag elseif (strpos($article['link'], 'www.timothywinchester.com/2') !== FALSE) { $doc = new DOMXpath($doc); $bread = $xpath->query("//a[contains(@href, 'bonus-panel')]")->item(0); $bread_page_url = $bread->getAttribute('href'); $xpath = new DOMDocument(); $doc->loadHTML($article['content']); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'uploads')]", $article); } // Dinosaur Comics Cleanup elseif (strpos($article['link'], '//theoatmeal.com/comics/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $img_tag . $article['content']; } // Pain Train (to get alt tags) elseif (strpos($article['link'], 'polyinpictures.com/comic/') !== FALSE) { //also get the blog $entries = $xpath->query("//div[@id='blarg']/div[last()]"); // Penny Arcade if(preg_match("@.*()@", $article['content'], $matches)){ if (preg_match("@.*(get_img_tags($xpath, '(//div[@class="container"]//center//img)', $article); // $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='content']/img", $article); } // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "www.smbc-comics.com/comic/") !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@class='comicpage']//img[contains(@src, 'ENG_')]", $article); $article['content'] .= "$orig_content"; // Awkward Zombie elseif (strpos($article['link'], 'paintraincomic.com/comic/') !== FALSE) { $imgs = $xpath->query('//img'); //doesn't get simpler than this } //No matches if ($img->getAttribute('title')) { $article['content'] .= "

" . $entry->ownerDocument->saveXML($entry) . ""; // Softer World (alt tags), Dinosaur Comics (alt tags+blog), CAD, attempt.

New Pull Request