On Tue, Nov 22, 2016 at 3:41 AM, Danny B. Wikipedia.Danny.B@email.cz wrote:
Hi,
a friend of mine is looking for examples of Bash code to edit MediaWiki via API (as far as I understood, login, logout, get page text, put text to the page (preferrably with custom tag); nothing more (unless needed)) for his project of sharing some open data.
He has some other Bash scripts which generate some text which he needs to save on wiki. Such text can be provided to the API edit part either via pipe, as a variable content or saved in file (that's the preferred order of possibilities).
If you have or know about any examples, please let me know (feel free to reply off-list with attachments), so I can forward it to him.
Thanks for any help in advance.
Kind regards
Danny B.
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Ok. So I'm not sure if I should post this or not, but... Once upon a time, back when I didn't really know how to program, I wrote a bot in bash for updating an onwiki template for what articles are trending currently on enwikinews. Code is absolutely horrible and not something you should follow, but I suppose it is an example. There's source code at https://en.wikinews.org/wiki/User:Bawolff_bot (API might have changed slightly since that was written).
-- Bawolff