29 lines
827 B
PHP
29 lines
827 B
PHP
|
<?php
|
||
|
namespace Source;
|
||
|
|
||
|
use \Game;
|
||
|
|
||
|
class VNDB extends Source {
|
||
|
public $title = "VNDB";
|
||
|
protected function parse() {
|
||
|
global $config;
|
||
|
$client = new Client();
|
||
|
$client->connect();
|
||
|
$client->login($config['VNDB_USER'], $config['VNDB_PASSWORD']);
|
||
|
$date = (new Date("1 week ago"))->format('Y-m-d');
|
||
|
echo $date;
|
||
|
die();
|
||
|
$list = $client->sendCommand('get vn basic (released > "'.$date.'")');
|
||
|
|
||
|
foreach ($list as $gameData) {
|
||
|
$game = new Game;
|
||
|
$game->title = $gameData->title;
|
||
|
$game->author = $gameData->developer->display_name;
|
||
|
$game->date = $gameData->published_on / 1000;
|
||
|
$game->description = $descData->payload->metaDescription;
|
||
|
$game->url = 'https://gamejolt.com/games/'.$gameData->slug.'/'.$gameData->id;
|
||
|
$this->output .= $game->print();
|
||
|
}
|
||
|
}
|
||
|
}
|