Page MenuHomePhabricator

Create a Toolforge tutorial on running a cron'ed pywikibot script
Closed, DuplicatePublic

Description

[10:25]  <theglobetrotter>	How do I set up a bot on toolforge that edits the wiki at regular intervals?

This question was asked in the #wikimedia-cloud irc channel, unfortunately at a time when no one was providing answers. It is a good question though. There are many possible ways to answer, but a reasonably common solution would be to first create a pywikibot script to perform the edits and then to setup a cron job to run that script at some defined interval.

Tutorial should cover:

  • Standard tutorial header material (prerequisites, overview of steps)
  • Setting up Owner-only OAuth for pywikibot (maybe something to document on mw.o if not already there)
  • Using shared pywikibot code on Toolforge
  • Example of running a pywikibot provided script
  • Example of running a trivial custom script
  • Example of Grid Engine cron job
  • Example of Kubernetes CronJob object (might be a good excuse to work on some helper script for this)