commonsmisc

This repo contains some scripts for using with Commons mobile app, in future maybe other ways too. All scripts reside in https://tools.wmflabs.org/urbanecmbot/commonsmisc/, just append filename.

uploadsbyuser.py

This script return a single number representing number of total uploads of certain given user. This includes reuploads of files either uploaded by the same user or by somebody else.

Overview

feedback.py

This script returns various numbers about certain given user, like number of thanks they received or number of usages of their files at projects of the Wikimedia Foundation.

Overview

  • HTTP method: GET
  • Output - JSON
    • Keys are described below
    • status - string - ok or error, depending on successfullness of the request
    • labs - boolean, indicates if request was made with production (false) or beta (true) database
    • database - string, database that was queries (like "commonswiki" or "enwiki")
    • user - username of the user we're examining (you can use spaces or underscores, Martin Urbanec and Martin_Urbanec is the same)
    • errorCode - string - when status=="error", this described what actually happened, currently it may only be mustpassparams which means that not all mandatory parameters (see below) were passed to the script.
    • uniqueUsedImages - number - how many images was used in at least one article
    • articlesUsingImages - number - how many times was images uploaded by examined user used
    • thanksReceived - number - how many thanks have the user recieved
    • featuredImages - dictionary - how many images received particular award of Commons users
      • key is category name of the award, value is number of images that are in that category = received that award
    • deletedUploads - number - how many uploads uploaded by examined user was deleted
  • Parameters
    • user - mandatory - string - username of user you want to examine (you can use spaces or underscores, Martin Urbanec and Martin_Urbanec is the same)
    • fetch - optional - array; separated by | - values from the output that you want to receive - default value is calculate everything possible
    • db - optional - string - select other production database to be queried, cannot be used with labs
    • labs - optional - string - select beta/labs database to be queried, cannot be used with db
  • Example requests