This refactors the code so it can be called from other places, e.g. an HTTP handler, as well as from the command line.
Apologies for the confusing branch name, this pull request ended up doing something different from what I originally thought!
Notes
At the moment this code is very thrown together, and not terribly well thought through, but it works! I've split the code out into a couple of classes, MediawikiPage to represent the page we're updating, and MediawikiText to represent the text that we want to update the page with. We probably want to at least split out the comparison code, which I've made a start on in #25, but this should be good enough to get us going.
This refactors the code so it can be called from other places, e.g. an HTTP handler, as well as from the command line.
Apologies for the confusing branch name, this pull request ended up doing something different from what I originally thought!
Notes
At the moment this code is very thrown together, and not terribly well thought through, but it works! I've split the code out into a couple of classes,
MediawikiPage
to represent the page we're updating, andMediawikiText
to represent the text that we want to update the page with. We probably want to at least split out the comparison code, which I've made a start on in #25, but this should be good enough to get us going.Fixes #29