Archived
1
0
Fork 0
This repository has been archived on 2020-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
news-script/Source/Urq.php

22 lines
683 B
PHP

<?php
namespace Source;
use \Game;
class Urq extends Source {
public $title = "Библиотека URQ";
protected function parse() {
$text = $this->get_text('http://urq.plut.info/node/209');
$this->dom->loadStr($text, []);
unset($text);
$games = $this->dom->find('.view-NewGames tr');
foreach ($games as $gameBlock) {
$game = new Game;
$game->author = trim($gameBlock->find('.views-field-taxonomy-vocabulary-2')->innerHtml);
$game->title = trim($gameBlock->find('.views-field-title')->innerHtml);
$game->url = trim($gameBlock->find('.views-field-title a')->getAttribute('href'));
$this->output .= $game->print();
}
}
}