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/VNDB.php
Alexander Yakovlev 4fc40624a2 VNDB WIP
I need a new VNDB client. :-(
2018-05-10 14:31:36 +07:00

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();
}
}
}