by User:GreenC (en.wikipedia.org)
June 2020
MIT License
Numberof is a Wikipedia bot that creates and maintains these files:
- Commons:Data:Wikipedia_statistics/data.tab
- Commons:Data:Wikipedia_statistics/rank/*.tab
- Commons:Data:Wikipedia_statistics/meta.tab
..which are pages used by {{Wikipedia rank by size}}, {{NUMBEROF}} and Module:NUMBEROF across many wiki languages and projects.
In addition, the bot creates .tab pages for Module:NumberOf hosted on Ruwiki and a few others. NumberOf is a peer of NUMBEROF, with its own features and requirements. The files are:
Finally, the bot creates forks of the ranking files which are sorted with ties showing equal rank (eg. two wikis can both be ranked #42 if they are tied for that spot). Equal ranking is not supported by Module:NUMBEROF but the data is made available for use such as other templates:
- GNU Awk 4.1+
- BotWikiAwk (version Jan 2019 +)
- A bot User account with bot permissions on Commons
-
Install BotWikiAwk following setup instructions.
-
Add OAuth credentials to wikiget (installed with BotWikiAwk), which is the utility that uploads pages to Commons. See EDITSETUP.
-
Clone Numberof. For example: git clone https://github.com/greencardamom/Numberof
-
Edit ~/BotWikiAwk/lib/botwiki.awk
A. Set local URLs in section #1 and #2
B. Create a new 'case' entry in section #3, adjust the Home bot path created in step 2:
case "numberof": # Custom bot paths Home = "/data/project/projectname/numberof/" # path ends in "/" Agent = UserPage " (ask me about " BotName ")" Engine = 3 break
-
Set ~/Numberof/numberof.awk to mode 750, and change the first shebang line to the location of awk.
-
In numberof.awk in the "BEGIN {" section is a place for an email address for error reports.
- See the file toolforge.txt for how to run on Toolforge. Adjust to your local system if not on Toolforge.