Page List Bot
Re-implementation of the legacy Page List Bot, whose code is too tightly coupled to continue to work on.
The new Page List Bot is built as a frontend-backend application. To build the project, simply clone the repository and run:
cargo build --release --workspace
And find the compiled programs in target/release
. Currently a nightly build of rustc is required.
Components
The main function of Page List Bot is split into several small parts listed below. Each component has its own documentation.
Component | Description | Badge |
---|---|---|
Executable | ||
api_daemon | Proxy for all connections to MediaWiki API. | |
query | Query executor. | |
Library | ||
api_daemon_interface | JSON RPC interface definitions shared between the API Daemon and other programs. | |
ast | Abstract syntax tree (AST) for the query language. | |
env | Environment variable utilities. | |
intorinf | A special integer type holding either a finite integer value or an infinite value. | |
provider | Trait definition for data provider. | |
solver | Query solver. Each query opeartion is defined as a poll-able stream. | |
trioresult | A tri-way result type. Can hold a value, or a warning, or an error. |
Configuration and Environment Variables
Directory Hierarchy
The Page List Bot suite assumes the following directory hierarchy:
${PAGELISTBOT_HOME}
├─ bin
│ ├─ api-daemon
│ ├─ query
│ └─ ...
├─ logs
│ ├─ logxxxxxx.log
│ └─ ...
└─ config.toml
PAGELISTBOT_HOME
is the environment variable used to locate the installation directory. If it is not specified, ~/.pagelistbot
is used.
Configuration File
The configuration is stored in config.toml
. It follows TOML syntax:
[site key 1]
key1 = value1
key2 = value2
[site key 2]
key1 = value1
key2 = value2
...
It is shared between programs, each reading different parts of the configuration.
Be careful. Bot username and password may be saved into this file. This file should therefore be considered confidential.