Archived
1
0
Fork 0
This commit is contained in:
Alexander Yakovlev 2018-03-25 02:49:32 +07:00
parent 40fc02bfcb
commit 0f15e8bcef
2 changed files with 12 additions and 15 deletions

View file

@ -7,21 +7,20 @@ class Qsp extends Source {
public $title = "Библиотека QSP";
protected function parse() {
$text = $this->get_text("http://qsp.su/index.php?option=com_sobi2&sobi2Task=rss&no_html=1&catid=1&Itemid=55");
$this->dom->loadStr($text, []);
$this->loadStr($text);
unset($text);
$games = $this->dom->find('channel item');
foreach ($games as $gameBlock) {
$date = trim($gameBlock->find('pubDate')->innerHtml, "() \t\n\r\0\x0B");
$this->dom->filter('channel item')->each(function($gameBlock){
$date = trim($gameBlock->filter('pubDate')->text(), "() \t\n\r\0\x0B");
$date = new \DateTime($date);
if ($date === false) continue;
if ($date === false) return;
$date = $date->format('U');
if ($date < $this->period) continue;
if ($date < $this->period) return;
$game = new Game;
$game->author = trim($gameBlock->find('category')->innerHtml);
$game->title = trim($gameBlock->find('title')->innerHtml);
$game->url = trim($gameBlock->find('link')[0]->innerHtml);// not working because XML
$game->description = trim($gameBlock->find('description')->innerHtml);
$game->author = trim($gameBlock->filter('category')->text());
$game->title = trim($gameBlock->filter('title')->text());
$game->url = trim($gameBlock->filter('link:first-child')->text());
$game->description = trim($gameBlock->filter('description')->text());
$this->output .= $game->print();
}
});
}
}

View file

@ -21,12 +21,11 @@ if (PHP_SAPI !== 'cli') {
}
if ($parsers === 'all' || in_array('all', $parsers)) {
$parsers = [
// 'urq',
'urq',
'anivisual',
'kvester',
'apero',
'instead',
//'storymaze',
'hyperbook_ru',
'hyperbook_en',
'questbook',
@ -47,12 +46,11 @@ function check($classname, $command) {
}
}
//check ('Urq', 'urq');
check ('Urq', 'urq');
check ('Qsp', 'qsp');
check ('Kvester', 'kvester');
check ('Apero', 'apero');
check ('Instead', 'instead');
check ('Storymaze', 'storymaze');
check ('Hyperbook', 'hyperbook_ru');
check ('Questbook', 'questbook');
check ('Anivisual', 'anivisual');