Добавил парсер второй RSS квестбука
This commit is contained in:
parent
307404bcdf
commit
4423dad504
|
@ -23,7 +23,12 @@ use \Game;
|
||||||
class Questbook extends Source {
|
class Questbook extends Source {
|
||||||
public $title = "Библиотека книг-игр";
|
public $title = "Библиотека книг-игр";
|
||||||
protected function parse() {
|
protected function parse() {
|
||||||
$string = $this->get_text('https://quest-book.ru/directory/rss/');
|
$this->parseFeed('https://quest-book.ru/directory/rss/');
|
||||||
|
$this->parseFeed('https://quest-book.ru/online/rss.xml');
|
||||||
|
}
|
||||||
|
protected function parseFeed($feedUrl) {
|
||||||
|
$string = $this->get_text($feedUrl);
|
||||||
|
$string = mb_convert_encoding($string, 'UTF-8', 'auto');
|
||||||
$service = new \Sabre\Xml\Service();
|
$service = new \Sabre\Xml\Service();
|
||||||
$service->elementMap = [
|
$service->elementMap = [
|
||||||
'{}item' => function(\Sabre\Xml\Reader $reader) {
|
'{}item' => function(\Sabre\Xml\Reader $reader) {
|
||||||
|
@ -53,7 +58,7 @@ class Questbook extends Source {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function checkPage($url) {
|
public function checkPage($url) {
|
||||||
return (strpos($url,'https://quest-book.ru/directory/') !== FALSE);
|
return (strpos($url,'https://quest-book.ru/') !== FALSE);
|
||||||
}
|
}
|
||||||
public function page($url) {
|
public function page($url) {
|
||||||
$game = new Game;
|
$game = new Game;
|
||||||
|
|
Reference in a new issue