WikiaActivityLogger

WikiaActivityLogger is a system of transferring information from recent changes, log and abuse log of a wiki through transport systems (currently, only supported transport system is Discord, see Contributing on how to add more). The author of the project is KockaAdmiralac and it is licensed under CC-BY-SA 4.0 license.

Installation
In order to install the program, you would need an installation of Node.js on the machine you want to run the logging bot on.

After installing Node.js, you would have to download the codebase from either this link or by cloning it through command-line Git with: git clone https://github.com/KockaAdmiralac/WikiaActivityLogger.git

In the downloaded folder there will be a folder titled, which contains 4 files,  ,  ,   and. Those 4 scripts are used for installing and running the bot on Windows and Linux.

Windows

 * 1) Open the   folder
 * 2) Click on   and wait for the console window to close
 * 3) Configure the bot
 * 4) Run   to start the bot

Linux

 * Instructions below are for the command-line Linux

 chmod +x scripts.sh chmod +x install.sh ./install.sh
 * 1) Navigate to the   folder
 * 2) Use
 * 1) Configure the bot
 * 2) Use ./start.sh to start the bot

Configuration
The bot needs to be configured in order to run it. The configuration is done through the file, which follows JSON markup. In the initial directory, you should see a file named, which contains sample configuration that can be freely renamed to  , however the bot won't function properly without some modifications.

Wikis
The wikis bot should listen on are configured through the  property of the configuration object. One wiki configuration can contain:


 * Configures the transport method, the bot does not work without it.
 * Required property in the object is, which decides what platform should the bot log the information to. However, the only currently supported is Discord, so this parameter must always be set to
 * Other configuration depends on the transport method
 * Discord transport currently requires a webhook to be made on the server you want the bot to log to. To create a webhook, go to channel settings of the channel you want the bot to log information to, and select the menu "Webhooks". Then create a new webhook, configure it to your liking, and copy the webhook URL. The webhook URL consists of a webhook ID and token (which are stored in the configuration parameters  and  ) in the following format
 * Discord transport currently requires a webhook to be made on the server you want the bot to log to. To create a webhook, go to channel settings of the channel you want the bot to log information to, and select the menu "Webhooks". Then create a new webhook, configure it to your liking, and copy the webhook URL. The webhook URL consists of a webhook ID and token (which are stored in the configuration parameters  and  ) in the following format

httрs://discordapp.com/api/webhooks/ webhook ID / webhook token
 * For example, if webhook link is

httрs://discordapp.com/api/webhooks/ 123456789 / aosBaAodia-oIA9DAkasd-9jASdlkAdu-7Askanadki-IASd8Asnak
 * the configuration would be


 * Note: Do not share your webhook URL with anybody! If it gets into malicious hands, worst that can happen is that the logging channel get spammed with messages sent from outside the server and you wouldn't be able to stop them unless you delete the webhook through which the person with malicious intents is writing and create a new one.


 * Interval in which the bot checks for new events in Recent Changes, Log and Abuse Log. Smaller intervals mean the bot is generating more internet traffic.
 * Default value is set to, which means the bot checks on every 0.5 seconds.
 * Modifying this interval depending on the wiki activity is highly advised so the bot consumes an optimal amount of internet traffic. If you are setting up the bot for a dead wiki, an optimal interval would be about 5 seconds.
 * Modifying this interval depending on the wiki activity is highly advised so the bot consumes an optimal amount of internet traffic. If you are setting up the bot for a dead wiki, an optimal interval would be about 5 seconds.


 * The user to exclude while fetching Recent Changes information.
 * For example, if you're setting the bot up for your test wiki it would make sense to put your username in this parameter, as you already know what are you doing on your test wiki
 * For example, if you're setting the bot up for your test wiki it would make sense to put your username in this parameter, as you already know what are you doing on your test wiki


 * Array of Log types to listen to and log.
 * Available log types:,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  , ,
 * Log types that require certain rights and hence haven't been implemented:,  ,  ,  ,  ,
 * Log types that won't be implemented: ,
 * Example configuration where the bot only listens to blocks, protections and avatar changes:
 * Example configuration where the bot only listens to blocks, protections and avatar changes:


 * Language to use in the logger.
 * Note that this won't modify the user interface language, as it's not currently translatable.
 * See the list of supported languages below.
 * Example configuration if you want to set the language to Spanish:
 * Example configuration if you want to set the language to Spanish:


 * Array of strings representing which sources to fetch data from.
 * Can contain  or   if you want the bot to listen for recent changes,   if you want the bot to listen for new log events, and ,   or   for abuse filter log.
 * By default, it only listens for recent changes and log events
 * For example, if you want to listen for log and abuse filter events:
 * Note: Abuse filter events won't be logged unless the bot is logged in
 * Note: Abuse filter events won't be logged unless the bot is logged in
 * Note: Abuse filter events won't be logged unless the bot is logged in

Logging in
In order to listen to some events (for example, abuse filter events), the bot has to be logged in. To log the bot in, an  property must be supplied to the configuration object. The object consists of three properties:

Examples
In this section are given examples on how to fully configure the bot.


 * Basic
 * This configuration makes the bot listen on Community Test wiki's recent changes and log


 * Multiple wikis
 * This configuration makes the bot listen on both Community Central's and Community Test's recent changes and log


 * Custom interval
 * This configuration makes the bot listen on Community Test wiki's recent changes and log, on every 5 seconds instead of default 0.5 seconds.


 * Excluding
 * This configuration makes the bot listen on Community Test wiki's recent changes and log but doesn't listen to changes made by Sactage


 * Log type filter
 * This configuration makes the bot listen on Community Test wiki's recent changes and log but out of all log events reports only uploads and protections


 * Different language
 * This configuration makes the bot listen on Community Test wiki's recent changes and log but the language is set to Spanish instead of English


 * Different log sources
 * This configuration makes the bot listen on Community Central's log and abuse log


 * Logging in
 * This configuration makes the bot listen to Community Test wiki's recent changes and log while being logged in
 * The program will prompt for a password when started


 * Logging in with a pre-given password
 * This configuration makes the bot listen to Community Test wiki's recent changes and log while being logged in
 * The program won't prompt for a password when started
 * Note: Please do not share your  file with other people if you are using this method of logging in!


 * Logging in onto another domain
 * This configuration makes the bot listen to Community Test wiki's recent changes and log while being logged in
 * The bot logs in onto Community Test wiki instead of Community Central


 * Combined
 * This configuration makes the bot listen on Community Test wiki's recent changes and log and Community Central's recent changes, log and abuse log
 * On Community Test wiki, log events will be filtered so only uploads and protections are logged, refresh interval is 5 seconds and logging is done on Spanish
 * On Community Central, Sactage's actions won't be logged.
 * Bot would log in as KockaBot and the user will be prompted for password when the program starts

Usage
The bot can be controlled through the command line after it starts. Several commands can be entered in the command line to control the bot while it's running.

Normal commands are given as command parameter1 parameter2 parameter3 ... If a command starts with, the command will be interpreted as a wiki command, a command given to a specific wiki listener:
 * 1) wikidomain command parameter1 parameter2 parameter3 ...

Normal commands

 * Shuts the client down
 * Command aliases:,  ,  ,  ,
 * Command aliases:,  ,  ,  ,


 * Crashes the client. Has no different effect than shutting the client normally whatsoever, except that  is called instead of
 * Crashes the client. Has no different effect than shutting the client normally whatsoever, except that  is called instead of


 * Restarts the client
 * Command aliases: ,
 * Command aliases: ,


 * Provides information from  file about program name, version, description, author, webpage, license, and also gives runtime information such as which wikis are currently being listened on and what is the account bot is currently logged in.
 * Provides information from  file about program name, version, description, author, webpage, license, and also gives runtime information such as which wikis are currently being listened on and what is the account bot is currently logged in.

Wiki commands

 * Stops listening on the given wiki
 * There is no restart command for specific wikis yet
 * Command aliases:,  ,  ,  ,
 * Command aliases:,  ,  ,  ,

Code
Contributing to WikiaActivityLogger's code requires forking the repository on GitHub, and making a new pull request once you finish your changes. You will be added to the contributors section if and when your pull request is merged.

If you are new to using Git, you can read Git basics here.

Translation
Currently supported logging languages are:
 * — English
 * — Spanish, translation done by Unai01

To translate the logger, you need to translate this file and then either post it on the author's talkpage or make a pull request as described above, putting your file in the directory, named  , where   is a language code of your language.

Note: In the file, object keys and template names do not need to be translated. For example, translation of into Serbian would be

Changelog

 * v1.0.0
 * Initial publicly documented version