' . $item->genre . '
' . $item->chaptercount . '
'; + $this->items[] = $item; + } + } + + if($type === "path") { + + $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 = new \Item(); + $item->title = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue); + $item->uri = 'http://www.mangareader.net' . $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); + } + } + + // Return some dummy-data if no content available + if(count($this->items) == 0){ + $item = new \Item(); + $item->content = "No updates available
"; + + $this->items[] = $item; + } + } + + public function getName(){ + return (!empty($this->request) ? $this->request . ' - ' : '') . 'Mangareader Bridge'; + } + + public function getURI(){ + return 'http://www.mangareader.net'; + } + + public function getCacheDuration(){ + return 10800; // 3 hours + } +} +?> \ No newline at end of file