oreolek
/
news-script
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/wiki.php

65 lines
1.7 KiB
PHP
Raw Permalink Normal View History

#!/usr/bin/php
<?php
/*
A set of utilities for tracking text-based game releases
Copyright (C) 2017-2018 Alexander Yakovlev
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2019-07-29 09:35:32 +03:00
require "vendor/autoload.php";
2018-05-15 14:11:18 +03:00
use Symfony\Component\Yaml\Yaml;
2019-07-29 09:35:32 +03:00
use Oreolek\Game;
use Oreolek\Source;
use Oreolek\Wikipage;
2018-05-15 14:11:18 +03:00
$config = Yaml::parse(file_get_contents('config.yml'));
if (!isset($argv[1])) {
echo 'Please provide the direct URL to the game page.'.PHP_EOL;
die();
}
2018-03-29 10:42:44 +03:00
$url = $argv[1];
2019-05-15 21:27:32 +03:00
$game = new Game();
function check($classname) {
global $game;
global $url;
2019-08-02 06:56:09 +03:00
$cname = 'Oreolek\\Source\\'.$classname;
$cl = (new $cname());
if ($cl->checkPage($url)) {
2018-03-29 10:42:44 +03:00
echo 'Используется правило "'.$cl->title.'".'.PHP_EOL;
if (!$cl->delayedLoad) {
$cl->loadStr($cl->get_text($url));
}
$game = $cl->page($url);
2018-03-22 09:39:02 +02:00
if ($game) {
2018-03-23 20:00:43 +02:00
$page = new Wikipage($game);
$page->create();
2018-03-22 09:39:02 +02:00
}
}
}
2019-05-15 21:27:32 +03:00
check ('Urq');
check ('Qsp');
check ('Kvester');
check ('Apero');
check ('Instead');
check ('Hyperbook');
check ('HyperbookEn');
check ('Questbook');
check ('Anivisual');
check ('Itch');
check ('Gamejolt');
check ('Steam');