Module: MediaWiktory::Wikipedia::Modules::Allusers

Defined in:
lib/mediawiktory/wikipedia/modules/allusers.rb

Overview

Enumerate all registered users.

The "submodule" (MediaWiki API term) is included in action after setting some param, providing additional tweaking for this param. Example (for Actions::Query and its submodules):

api.query             # returns Actions::Query
   .prop(:revisions)  # adds prop=revisions to action URL, and includes Modules::Revisions into action
   .limit(10)         # method of Modules::Revisions, adds rvlimit=10 to URL

All submodule's parameters are documented as its public methods, see below.

Instance Method Summary collapse

Instance Method Details

#activeusersself

Only list users active in the last 30 days.

Returns:

  • (self)


128
129
130
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 128

def activeusers()
  merge(auactiveusers: 'true')
end

#attachedwiki(value) ⇒ self

With auprop=centralids, also indicate whether the user is attached with the wiki identified by this ID.

Parameters:

  • value (String)

Returns:

  • (self)


136
137
138
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 136

def attachedwiki(value)
  merge(auattachedwiki: value.to_s)
end

#dir(value) ⇒ self

Direction to sort in.

Parameters:

  • value (String)

    One of "ascending", "descending".

Returns:

  • (self)


49
50
51
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 49

def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end

#excludegroup(*values) ⇒ self

Exclude users in the given groups.

Parameters:

  • values (Array<String>)

    Allowed values: "bot", "sysop", "bureaucrat", "reviewer", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "founder", "rollbacker", "autoreviewer", "researcher", "filemover", "checkuser", "templateeditor", "massmessage-sender", "extendedconfirmed", "extendedmover", "patroller", "abusefilter", "confirmed", "epcoordinator", "eponline", "epcampus", "epinstructor".

Returns:

  • (self)


75
76
77
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 75

def excludegroup(*values)
  values.inject(self) { |res, val| res._excludegroup(val) or fail ArgumentError, "Unknown value for excludegroup: #{val}" }
end

#from(value) ⇒ self

The user name to start enumerating from.

Parameters:

  • value (String)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 25

def from(value)
  merge(aufrom: value.to_s)
end

#group(*values) ⇒ self

Only include users in the given groups.

Parameters:

  • values (Array<String>)

    Allowed values: "bot", "sysop", "bureaucrat", "reviewer", "steward", "accountcreator", "import", "transwiki", "ipblock-exempt", "oversight", "founder", "rollbacker", "autoreviewer", "researcher", "filemover", "checkuser", "templateeditor", "massmessage-sender", "extendedconfirmed", "extendedmover", "patroller", "abusefilter", "confirmed", "epcoordinator", "eponline", "epcampus", "epinstructor".

Returns:

  • (self)


62
63
64
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 62

def group(*values)
  values.inject(self) { |res, val| res._group(val) or fail ArgumentError, "Unknown value for group: #{val}" }
end

#limit(value) ⇒ self

How many total user names to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


114
115
116
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 114

def limit(value)
  merge(aulimit: value.to_s)
end

#prefix(value) ⇒ self

Search for all users that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 41

def prefix(value)
  merge(auprefix: value.to_s)
end

#prop(*values) ⇒ self

Which pieces of information to include:

Parameters:

  • values (Array<String>)

    Allowed values: "blockinfo" (Adds the information about a current block on the user), "groups" (Lists groups that the user is in. This uses more server resources and may return fewer results than the limit), "implicitgroups" (Lists all the groups the user is automatically in), "rights" (Lists rights that the user has), "editcount" (Adds the edit count of the user), "registration" (Adds the timestamp of when the user registered if available (may be blank)), "centralids" (Adds the central IDs and attachment status for the user).

Returns:

  • (self)


101
102
103
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 101

def prop(*values)
  values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
end

#rights(*values) ⇒ self

Only include users with the given rights. Does not include rights granted by implicit or auto-promoted groups like *, user, or autoconfirmed.

Parameters:

  • values (Array<String>)

    Allowed values: "apihighlimits", "applychangetags", "autoconfirmed", "autocreateaccount", "autopatrol", "bigdelete", "block", "blockemail", "bot", "browsearchive", "changetags", "createaccount", "createpage", "createtalk", "delete", "deletechangetags", "deletedhistory", "deletedtext", "deletelogentry", "deleterevision", "edit", "editcontentmodel", "editinterface", "editprotected", "editmyoptions", "editmyprivateinfo", "editmyusercss", "editmyuserjs", "editmywatchlist", "editsemiprotected", "editusercss", "edituserjs", "hideuser", "import", "importupload", "ipblock-exempt", "managechangetags", "markbotedits", "mergehistory", "minoredit", "move", "movefile", "move-categorypages", "move-rootuserpages", "move-subpages", "nominornewtalk", "noratelimit", "override-export-depth", "pagelang", "patrol", "patrolmarks", "protect", "purge", "read", "reupload", "reupload-own", "reupload-shared", "rollback", "sendemail", "siteadmin", "suppressionlog", "suppressredirect", "suppressrevision", "unblockself", "undelete", "unwatchedpages", "upload", "upload_by_url", "userrights", "userrights-interwiki", "viewmyprivateinfo", "viewmywatchlist", "viewsuppressed", "writeapi", "spamblacklistlog", "tboverride", "tboverride-account", "titleblacklistlog", "gadgets-edit", "gadgets-definition-edit", "globalblock", "globalblock-whitelist", "globalblock-exempt", "securepoll-create-poll", "renameuser", "nuke", "torunblocked", "skipcaptcha", "override-antispoof", "centralauth-merge", "centralauth-unmerge", "centralauth-lock", "centralauth-oversight", "globalgrouppermissions", "globalgroupmembership", "centralauth-rename", "centralauth-usermerge", "abusefilter-modify", "abusefilter-log-detail", "abusefilter-view", "abusefilter-log", "abusefilter-private", "abusefilter-modify-restricted", "abusefilter-revert", "abusefilter-view-private", "abusefilter-log-private", "abusefilter-hidden-log", "abusefilter-hide-log", "abusefilter-modify-global", "massmessage", "vipsscaler-test", "ep-org", "ep-course", "ep-token", "ep-enroll", "ep-remstudent", "ep-online", "ep-campus", "ep-instructor", "ep-beonline", "ep-becampus", "ep-beinstructor", "ep-bereviewer", "ep-remreviewer", "ep-bulkdelorgs", "ep-bulkdelcourses", "ep-remarticle", "ep-addstudent", "usermerge", "mwoauthproposeconsumer", "mwoauthupdateownconsumer", "mwoauthmanageconsumer", "mwoauthsuppress", "mwoauthviewsuppressed", "mwoauthviewprivate", "mwoauthmanagemygrants", "oathauth-enable", "oathauth-api-all", "checkuser", "checkuser-log", "autoreviewrestore", "stablesettings", "review", "unreviewedpages", "movestable", "validate", "templateeditor", "editeditorprotected", "editextendedsemiprotected", "extendedconfirmed", "flow-create-board", "flow-edit-post", "flow-suppress", "flow-hide", "flow-delete", "viewdeletedfile", "autoreview", "transcode-reset", "transcode-status", "collectionsaveasuserpage", "collectionsaveascommunitypage".

Returns:

  • (self)


88
89
90
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 88

def rights(*values)
  values.inject(self) { |res, val| res._rights(val) or fail ArgumentError, "Unknown value for rights: #{val}" }
end

#to(value) ⇒ self

The user name to stop enumerating at.

Parameters:

  • value (String)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 33

def to(value)
  merge(auto: value.to_s)
end

#witheditsonlyself

Only list users who have made edits.

Returns:

  • (self)


121
122
123
# File 'lib/mediawiktory/wikipedia/modules/allusers.rb', line 121

def witheditsonly()
  merge(auwitheditsonly: 'true')
end