Skip to content

Manu404/WikiDiscordNotifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WikiDiscordNotifier

Build status

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.

Distribution

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.

Note
  • On Windows, wikiref will be replaced by wikiref.exe

  • On Linux a chmod +x wikiref might be required to have it work

Basic usage

politilog --domain https://mywiki.com/ --wiki /wiki/ --api /w/api.php --webhook <discord_webhook_url> --language "fr-FR" 

Parameter reference

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

Localization

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.

How does it keep track of changes ?

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.

Scheduling

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.

Install .Net 7 Runtime

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.

Building the tool

Getting the code

Clone the repository and you're, there's on submodules used by this project.

Dependencies

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:

If under linux:

Compilation

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

Remarks

  • Sadly, WSL has compatibility issues with the "dotnet" command, so it can't being used.

Build for unofficially supported system

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"

About

A discord webhook to publish change event to discord

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published