Module: MediaWiktory::Wikipedia::Modules::Querypage

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

Overview

Get a list provided by a QueryPage-based special page.

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

#limit(value) ⇒ self

Number of results to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


46
47
48
# File 'lib/mediawiktory/wikipedia/modules/querypage.rb', line 46

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

#offset(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (Integer)

Returns:

  • (self)


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

def offset(value)
  merge(qpoffset: value.to_s)
end

#page(value) ⇒ self

The name of the special page. Note, this is case sensitive.

Parameters:

  • value (String)

    One of "Ancientpages", "BrokenRedirects", "Deadendpages", "DoubleRedirects", "ListDuplicatedFiles", "Listredirects", "Lonelypages", "Longpages", "MediaStatistics", "Mostcategories", "Mostimages", "Mostinterwikis", "Mostlinkedcategories", "Mostlinkedtemplates", "Mostlinked", "Mostrevisions", "Fewestrevisions", "Shortpages", "Uncategorizedcategories", "Uncategorizedpages", "Uncategorizedimages", "Uncategorizedtemplates", "Unusedcategories", "Unusedimages", "Wantedcategories", "Wantedfiles", "Wantedpages", "Wantedtemplates", "Unwatchedpages", "Unusedtemplates", "Withoutinterwiki", "UnconnectedPages", "PagesWithBadges", "EntityUsage", "GadgetUsage", "MostGloballyLinkedFiles", "GloballyWantedFiles", "DisambiguationPages", "DisambiguationPageLinks".

Returns:

  • (self)


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

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