You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

65 lines
1.7 KiB

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