Module: MediaWiktory::Wikipedia::Modules::Siteinfo

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

Overview

Return general information about the site.

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

#filteriw(value) ⇒ self

Return only local or only nonlocal entries of the interwiki map.

Parameters:

  • value (String)

    One of "local", "!local".

Returns:

  • (self)


38
39
40
# File 'lib/mediawiktory/wikipedia/modules/siteinfo.rb', line 38

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

#inlanguagecode(value) ⇒ self

Language code for localised language names (best effort) and skin names.

Parameters:

  • value (String)

Returns:

  • (self)


65
66
67
# File 'lib/mediawiktory/wikipedia/modules/siteinfo.rb', line 65

def inlanguagecode(value)
  merge(siinlanguagecode: value.to_s)
end

#numberingroupself

Lists the number of users in user groups.

Returns:

  • (self)


57
58
59
# File 'lib/mediawiktory/wikipedia/modules/siteinfo.rb', line 57

def numberingroup()
  merge(sinumberingroup: 'true')
end

#prop(*values) ⇒ self

Which information to get:

Parameters:

  • values (Array<String>)

    Allowed values: "general" (Overall system information), "namespaces" (List of registered namespaces and their canonical names), "namespacealiases" (List of registered namespace aliases), "specialpagealiases" (List of special page aliases), "magicwords" (List of magic words and their aliases), "interwikimap" (Returns interwiki map (optionally filtered, optionally localised by using siinlanguagecode)), "dbrepllag" (Returns database server with the highest replication lag), "statistics" (Returns site statistics), "usergroups" (Returns user groups and the associated permissions), "libraries" (Returns libraries installed on the wiki), "extensions" (Returns extensions installed on the wiki), "fileextensions" (Returns list of file extensions (file types) allowed to be uploaded), "rightsinfo" (Returns wiki rights (license) information if available), "restrictions" (Returns information on available restriction (protection) types), "languages" (Returns a list of languages MediaWiki supports (optionally localised by using siinlanguagecode)), "languagevariants" (Returns a list of language codes for which LanguageConverter is enabled, and the variants supported for each), "skins" (Returns a list of all enabled skins (optionally localised by using siinlanguagecode, otherwise in the content language)), "extensiontags" (Returns a list of parser extension tags), "functionhooks" (Returns a list of parser function hooks), "showhooks" (Returns a list of all subscribed hooks (contents of $wgHooks)), "variables" (Returns a list of variable IDs), "protocols" (Returns a list of protocols that are allowed in external links), "defaultoptions" (Returns the default values for user preferences), "uploaddialog" (Returns the upload dialog configuration).

Returns:

  • (self)


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

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

#showalldbself

List all database servers, not just the one lagging the most.

Returns:

  • (self)


50
51
52
# File 'lib/mediawiktory/wikipedia/modules/siteinfo.rb', line 50

def showalldb()
  merge(sishowalldb: 'true')
end