Archived
1
0
Fork 0

Комментарии и README

This commit is contained in:
Alexander Yakovlev 2019-04-16 12:52:05 +07:00
parent 07fd2f03f0
commit ed9bb62db2
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3
3 changed files with 51 additions and 13 deletions

View file

@ -1,7 +1,9 @@
# A set of utilities for tracking text-based game releases # A set of utilities for tracking text-based game releases
Originally a parser for Russian Interactive Fiction, now it's much more than that. Originally a parser for Russian Interactive Fiction, now it's much more than that.
There are three executable PHP scripts here that serve different functions but share the code. [Русская версия readme](README.rus.md)
These are executable PHP scripts that serve different functions but share the code.
### run.php ### run.php
This one was the first. This one was the first.
@ -15,6 +17,9 @@ This one does the same in continuous fashion, posting the feed to Mastodon or Te
And this one makes wiki pages for the [IFWiki](http://ifwiki.ru). And this one makes wiki pages for the [IFWiki](http://ifwiki.ru).
It uses Russian IFWiki syntax and templates but it would be easy to alter for the English IFWiki as well if you'd want that. It uses Russian IFWiki syntax and templates but it would be easy to alter for the English IFWiki as well if you'd want that.
### kril.php
Just ignore this, it's for Russian IF comp.
## Installation ## Installation
1. Copy the `config.yml.example` to `config.yml`, edit it. 1. Copy the `config.yml.example` to `config.yml`, edit it.

33
README.rus.md Normal file
View file

@ -0,0 +1,33 @@
# Утилиты для отслеживания релизов текстовых игр
Изначально парсер для русской интерактивной литературы, теперь нечто большее.
Каждый скрипт делает что-то своё, но основной код у них общий.
### run.php
Этот был первым, он самый простой.
Он сканирует хостинги игр, находит новые релизы за последнюю неделю и выводит
в консоль список в форматах Markdown или HTML. Всё автоматически.
Если передать параметр, например, `itch`, то он сканирует только указанный сайт.
Второй параметр - URL страницы, чтобы просканировать страницу одной игры.
### bot.php
То же самое, но постоянно и постит вывод в Mastodon и/или Telegram.
### wiki.php
Сканирует страницу одной игры и создаёт записи на [IFWiki.](http://ifwiki.ru)
Если страница уже есть на вики, выводит текст, который хотел записать.
Автоматически заменять текст не пытается, это надо смотреть вручную.
Если находит обложку игры, тоже заливает её на вики.
### kril.php
Оформление результатов [КРИЛа 2018.](http://kril.ifiction.ru)
## Установка
1. Скопировать `config.yml.example` в `config.yml`, отредактировать.
1. Параметр `DRY_RUN` отвечает за тест: `true` означает, что скрипты бота и вики не попытаются создавать страницы и постить записи, а выведут текст и закончат работу.
1. Скачать [`composer`](https://getcomposer.org/) и выполнить `composer install`
1. Запустить скрипты. (консольный php 7+ с установленными php-xml и php-mbstring)

View file

@ -1,14 +1,14 @@
DRY_RUN: true DRY_RUN: true
TELEGRAM: true TELEGRAM: true # нужен ли Telegram
MASTODON: true MASTODON: true # нужен ли Mastodon
MASTODON_ACCESS_TOKEN: token MASTODON_ACCESS_TOKEN: token # токен аккаунта Mastodon
MASTODON_SERVER: https://botsin.space MASTODON_SERVER: https://botsin.space
MASTODON_USER: user MASTODON_USER: user
TELEGRAM_API_KEY: some-key-here TELEGRAM_API_KEY: some-key-here
TELEGRAM_BOT_NAME: bot name TELEGRAM_BOT_NAME: bot name
TELEGRAM_CHAT_ID: id TELEGRAM_CHAT_ID: id
BITLY_TOKEN: token BITLY_TOKEN: token # токен сервиса сокращения ссылок bit.ly для Mastodon и Telegram
parsers: # delete unused parsers: # delete unused / удалите ненужное
- -
classname: Qsp classname: Qsp
- -
@ -37,10 +37,10 @@ parsers: # delete unused
classname: Gamejolt classname: Gamejolt
- -
classname: Steam classname: Steam
STYLE: 'RUS' STYLE: 'RUS' # RUS / ENG
FORMAT: 'HTML' FORMAT: 'HTML' # HTML / MARKDOWN
WIKI: "https://ifwiki.ru/api.php" WIKI: "https://ifwiki.ru/api.php" # адрес API IFwiki
WIKIUSER: "wikiuser" WIKIUSER: "wikiuser" # логин юзера IFWiki
WIKIPASSWORD: "wikipassword" WIKIPASSWORD: "wikipassword" # пароль бота IFWiki
VNDB_USER: "vndbuser" VNDB_USER: "vndbuser" # логин VNDB
VNDB_PASSWORD: "vndbpassword" VNDB_PASSWORD: "vndbpassword" # пароль VNDB