Module: MediaWiktory::Wikipedia::Modules::GAllpages

Defined in:
lib/mediawiktory/wikipedia/modules/g-allpages.rb

Overview

Enumerate all pages sequentially in a given namespace. Generator module: for fetching pages corresponding to request.

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

#continue(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (String)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 33

def continue(value)
  merge(gapcontinue: value.to_s)
end

#dir(value) ⇒ self

The direction in which to list.

Parameters:

  • value (String)

    One of "ascending", "descending".

Returns:

  • (self)


146
147
148
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 146

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

Filter based on whether a page has langlinks. Note that this may not consider langlinks added by extensions.

Parameters:

  • value (String)

    One of "withlanglinks", "withoutlanglinks", "all".

Returns:

  • (self)


159
160
161
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 159

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

#filterredir(value) ⇒ self

Which pages to list.

Parameters:

  • value (String)

    One of "all", "redirects", "nonredirects".

Returns:

  • (self)


70
71
72
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 70

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

#from(value) ⇒ self

The page title to start enumerating from.

Parameters:

  • value (String)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 25

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

#limit(value) ⇒ self

How many total pages to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


138
139
140
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 138

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

#maxsize(value) ⇒ self

Limit to pages with at most this many bytes.

Parameters:

  • value (Integer)

Returns:

  • (self)


91
92
93
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 91

def maxsize(value)
  merge(gapmaxsize: value.to_s)
end

#minsize(value) ⇒ self

Limit to pages with at least this many bytes.

Parameters:

  • value (Integer)

Returns:

  • (self)


83
84
85
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 83

def minsize(value)
  merge(gapminsize: value.to_s)
end

#namespace(value) ⇒ self

The namespace to enumerate.

Parameters:

  • value (String)

    One of "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "446", "447", "710", "711", "828", "829", "2300", "2301", "2302", "2303".

Returns:

  • (self)


57
58
59
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 57

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

#prefix(value) ⇒ self

Search for all page titles that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


49
50
51
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 49

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

#prexpiry(value) ⇒ self

Which protection expiry to filter the page on:

Parameters:

  • value (String)

    One of "indefinite" (Get only pages with indefinite protection expiry), "definite" (Get only pages with a definite (specific) protection expiry), "all" (Get pages with any protections expiry).

Returns:

  • (self)


172
173
174
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 172

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

#prfiltercascade(value) ⇒ self

Filter protections based on cascadingness (ignored when apprtype isn't set).

Parameters:

  • value (String)

    One of "cascading", "noncascading", "all".

Returns:

  • (self)


125
126
127
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 125

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

#prlevel(*values) ⇒ self

Filter protections based on protection level (must be used with apprtype= parameter).

Parameters:

  • values (Array<String>)

    Allowed values: "autoconfirmed", "extendedconfirmed", "templateeditor", "sysop".

Returns:

  • (self)


112
113
114
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 112

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

#prtype(*values) ⇒ self

Limit to protected pages only.

Parameters:

  • values (Array<String>)

    Allowed values: "edit", "move", "upload".

Returns:

  • (self)


99
100
101
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 99

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

#to(value) ⇒ self

The page title to stop enumerating at.

Parameters:

  • value (String)

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/g-allpages.rb', line 41

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