A free, open source and multiplatform using Discord webhooks to publish message when a change is made in a MediaWiki project. The tool is triggered by cronjob that check periodically if new changes have been made and then post messages into discord channels about those changes.
Two kind of binaries are available:
-
Self-contained, or "portable": a single file with no other dependencies than scripts and language files.
-
Normal: a lighter file that requires the DotNet 7 runtime to be installed on the machine.
-
On Windows, wikiref will be replaced by wikiref.exe
-
On Linux a
chmod +x wikiref
might be required to have it work
politilog --domain https://mywiki.com/ --wiki /wiki/ --api /w/api.php --webhook <discord_webhook_url> --language "fr-FR"
Flag | Required | Description | ||
---|---|---|---|---|
-d | --domain | ⬤ | The domain of the wiki | |
-w | --wiki | ⬤ | The url of the wiki | |
-a | --api | ⬤ | the url of api.php | |
-h | --webhook | ⬤ | The url of the discord webhook | |
--language | Default to english. | |||
-l | --limit | Number of changes requested by queries. Max 500 (MediaWiki api limit). Default is 100. | ||
-n | --no-log | ⬤ | Don't output to logfile | |
-s | --silent | ⬤ | Don't output to console |
The localization file are located in the "Localization" folder of the app but are also a great way to customize what is displayed by the tools and which icons are used by the tools.
The tool is available in french, english, dutch, german and japanese, those localization have been reviewed by native speaker,
Arabic, Spain Spanish, Hindi, Portugese and Brazialian Portuguese, Russian and Chinese localization are also available, generated by ChatGPT and cross checked with other tools.
Whenever the tool has finish to run, he write the current date and time in UTC format in a file called last_change. Next time he runs, he check every changes since that date and time.
It can be useful to edit this file manually if you want to regenerate some messages, for instance, the first time you'll run the tool, he'll use the current date and time, if you wan to import a bit of history into your discord channel, edit that file and re-run the tool.
The best approach to using this tool is to adpapt the script provided in "cron.sh" and program a cronjob that execute the script regularly depending on your server load and preferences.
Is you don't want to use the portable version, go to the download page and download then install the ".NET Desktop Runtime 7". You can install the SDK if you want, but you'll end up with more than required to run the tool.
Clone the repository and you're, there's on submodules used by this project.
Build is done on Windows using gitbash (normally provided with git) or on Linux. You don't need any IDE like Visual Studio or similar. What you need is:
- Git for Windows: https://git-scm.com/download/win
- DotNet 7 SDK: https://dotnet.microsoft.com/en-us/download/dotnet/7.0
- Zip and bzip2 2 need to be added to your gitbash if you're on windows, (it's really easy to install); here's a straight forward tutorial: https://ranxing.wordpress.com/2016/12/13/add-zip-into-git-bash-on-windows/
If under linux:
- DotNet 7 SDK: https://dotnet.microsoft.com/en-us/download/dotnet/7.0
- Zip command
Once the dependencies are installed, you're ready to compile by yourself the project.
The compilation rely on two compile script:
-
build.sh: the root script containing project variable and calling a generic build script. You can edit it if you want to change what parameters are provided to the real build script, it's pretty straight forward.
-
multiplateform_build.sh: the "real" compile script, it can be given the following parameter. If a paramter is not given, an interactive prompt will ask you for informations
Parameter Description -t --target The target plateteforme (cfr suppported plateform) -p --project Path to the project file -n --name Project name used for the zip file -v --version Version use for the zip file -e --embeded Produce a SelfContained ("portable") file (default false) -a --all Build all plateform available
A clean is done before each build.
The build output is placed in ""./output/build/<plateform>""
A zip containing the build output is placed in "./output/zip/<plateform>.zip"
The zip name use the folllowing convention:
<name>_<version>_<plateform>.zip
- Sadly, WSL has compatibility issues with the "dotnet" command, so it can't being used.
You can build for 'unofficially supported system' using the -p parameter of the build script and using for a platform available in the list here
Example, building for macOS 13 Ventura ARM 64 : "./multiplateform_build -p osx.13-arm64"