' . $item['genre'] . '
' . $item['chaptercount'] . '
'; $this->items[] = $item; } break; case 'Get manga updates': $limit = $this->getInput('limit'); if(empty($limit)){ $limit = MANGAREADER_LIMIT; } $this->request = $xpath->query(".//*[@id='mangaproperties']//*[@class='aname']")->item(0)->nodeValue; $query = "(.//*[@id='listing']//tr)[position() > 1]"; if($limit !== -1){ $query = "(.//*[@id='listing']//tr)[position() > 1][position() > last() - " . $limit . "]"; } $chapters = $xpath->query($query); foreach ($chapters as $chapter){ $item = array(); $item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue); $item['uri'] = self::URI . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href'); $item['timestamp'] = strtotime($xpath->query("td[2]", $chapter)->item(0)->nodeValue); array_unshift($this->items, $item); } break; } // Return some dummy-data if no content available if(empty($this->items)){ $item = array(); $item['content'] = "No updates available
"; $this->items[] = $item; } } public function getURI(){ switch($this->queriedContext){ case 'Get latest updates': $path = "latest"; break; case 'Get popular mangas': $path = "popular"; if($this->getInput('category') !== "all"){ $path .= "/" . $this->getInput('category'); } break; case 'Get manga updates': $path = $this->getInput('path'); break; } return self::URI . $path; } public function getName(){ return (!empty($this->request) ? $this->request . ' - ' : '') . 'Mangareader Bridge'; } public function getCacheDuration(){ return 10800; // 3 hours } } ?>