No description
  • JavaScript 100%
Find a file
2026-07-03 21:52:33 -04:00
bin update xivstats url and also clean up some truly terrible programming 2026-07-03 21:41:22 -04:00
lib whoops i didnt want to commit that yet lol 2025-09-04 23:08:53 -04:00
.env.example Add killpage support 2025-08-20 00:02:44 -06:00
.gitignore Add .env support to make life easier 2025-08-20 00:02:08 -06:00
.nvmrc Add .nvmrc 2025-08-20 00:39:21 -06:00
package-lock.json Initial commit 2025-03-27 09:55:19 -04:00
package.json Restructure project files 2025-07-29 19:04:14 -04:00
README.md document real deployment setup 2026-07-03 21:52:33 -04:00

ffxiv-wiki-scripts

Wiki bot scripts for https://ffxiv.consolegameswiki.com.

  • bin/add-edb-ids: Attempts to fix items in Category:Missing EDB ID by looking them up in Eorzea Database and adding the appropriate id-edb infobox parameter.
  • bin/add-gt-ids: The same for Category:Missing internal ID, looking up internal IDs via XIVAPI and populating the id-gt parameter.
  • bin/update-desynth-data: Pulls item desynthesis data from https://xivstats.com and updates the wiki with the latest data, for use with the {{Desynthesis results}} template.

Scripts for other one-time maintenance tasks (e.g. bulk renames) can be found for bin/one-time, mostly just in case I need to repurpose them for other stuff in the future.

Usage

You'll need a recent version of Node.js (22+). Install dependencies: npm ci, rename .env.example to .env and set MW_USERNAME and MW_PASSWORD to your account username and bot password respectively, then run the scripts in the bin folder.

Environment variables

  • MW_SCRIPTPATH: The base URL for API requests for your wiki. For the XIV wiki it's https://ffxiv.consolegameswiki.com/mediawiki; other wikis may use paths other than /mediawiki, which can be identified in Special:Version as "Script path".
  • MW_USERNAME and MW_PASSWORD: Account username and bot password, respectively
  • MW_KILLPAGE: The name of a page that will be checked when running unattended scripts. If this page contains content, the bot will be killed. This allows other editors to kill the bot if it starts misbehaving and you're not watching it.

Devops

The desynth data script is currently being run daily from Erin's home server. It uses a daily systemd timer and runs under nvm. Here's how that's set up:

  • Clone this repo and edit the .env file as needed
  • Install nvm
  • Add the service: /etc/systemd/system/ffxiv-wiki-desynth.service
    [Unit]
    Description = Updates desynthesis data for the FFXIV wiki.
    [Service]
    Type=simple
    WorkingDirectory=/path/to/repo
    EnvironmentFile=/path/to/repo/.env
    ExecStart=/home/some-user/.nvm/nvm-exec /path/to/repo/bin/update-desynth-data
    
  • Add a generic daily timer that can be used to trigger other services: /etc/systemd/system/daily@.timer
    [Unit]
    Description = Daily timer for %i
    [Timer]
    OnCalendar=daily
    AccuracySec=6h
    RandomizeDelaySec=1h
    Persistent=true
    Unit=%i.service
    [Install]
    WantedBy=default.target
    
  • Enable an instance of the daily timer for the desynth service:
    $ systemctl enable daily@ffxiv-wiki-desynth.timer
    
  • If needed, the service can also be started manually to trigger the script:
    $ systemctl start ffxiv-wiki-desynth.service