module MediaWiktory::Wikipedia::Modules::Allimages

Enumerate all images sequentially.

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

“`ruby 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.

Public Instance Methods

_dir(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 43
def _dir(value)
  defined?(super) && super || ["ascending", "descending", "newer", "older"].include?(value.to_s) && merge(aidir: value.to_s)
end
_filterbots(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 157
def _filterbots(value)
  defined?(super) && super || ["all", "bots", "nobots"].include?(value.to_s) && merge(aifilterbots: value.to_s)
end
_mime(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 170
def _mime(value)
  merge(aimime: value.to_s, replace: false)
end
_prop(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 96
def _prop(value)
  defined?(super) && super || ["timestamp", "user", "userid", "comment", "parsedcomment", "canonicaltitle", "url", "size", "dimensions", "sha1", "mime", "mediatype", "metadata", "commonmetadata", "extmetadata", "bitdepth", "badfile"].include?(value.to_s) && merge(aiprop: value.to_s, replace: false)
end
_sort(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 30
def _sort(value)
  defined?(super) && super || ["name", "timestamp"].include?(value.to_s) && merge(aisort: value.to_s)
end
continue(value) click to toggle source

When more results are available, use this to continue.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 67
def continue(value)
  merge(aicontinue: value.to_s)
end
dir(value) click to toggle source

The direction in which to list.

@param value [String] One of “ascending”, “descending”, “newer”, “older”. @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 38
def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end
end(value) click to toggle source

The timestamp to end enumerating. Can only be used with aisort=timestamp.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 83
def end(value)
  merge(aiend: value.iso8601)
end
filterbots(value) click to toggle source

How to filter files uploaded by bots. Can only be used with aisort=timestamp. Cannot be used together with aiuser.

@param value [String] One of “all”, “bots”, “nobots”. @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 152
def filterbots(value)
  _filterbots(value) or fail ArgumentError, "Unknown value for filterbots: #{value}"
end
from(value) click to toggle source

The image title to start enumerating from. Can only be used with aisort=name.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 51
def from(value)
  merge(aifrom: value.to_s)
end
limit(value) click to toggle source

How many images in total to return.

@param value [Integer, “max”] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 178
def limit(value)
  merge(ailimit: value.to_s)
end
maxsize(value) click to toggle source

Limit to images with at most this many bytes.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 120
def maxsize(value)
  merge(aimaxsize: value.to_s)
end
mime(*values) click to toggle source

Disabled due to miser mode.

@param values [Array<String>] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 165
def mime(*values)
  values.inject(self) { |res, val| res._mime(val) }
end
minsize(value) click to toggle source

Limit to images with at least this many bytes.

@param value [Integer] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 112
def minsize(value)
  merge(aiminsize: value.to_s)
end
prefix(value) click to toggle source

Search for all image titles that begin with this value. Can only be used with aisort=name.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 104
def prefix(value)
  merge(aiprefix: value.to_s)
end
prop(*values) click to toggle source

Which file information to get:

@param values [Array<String>] Allowed values: “timestamp” (Adds timestamp for the uploaded version), “user” (Adds the user who uploaded each file version), “userid” (Add the ID of the user that uploaded each file version), “comment” (Comment on the version), “parsedcomment” (Parse the comment on the version), “canonicaltitle” (Adds the canonical title of the file), “url” (Gives URL to the file and the description page), “size” (Adds the size of the file in bytes and the height, width and page count (if applicable)), “dimensions” (Alias for size), “sha1” (Adds SHA-1 hash for the file), “mime” (Adds MIME type of the file), “mediatype” (Adds the media type of the file), “metadata” (Lists Exif metadata for the version of the file), “commonmetadata” (Lists file format generic metadata for the version of the file), “extmetadata” (Lists formatted metadata combined from multiple sources. Results are HTML formatted), “bitdepth” (Adds the bit depth of the version), “badfile” (Adds whether the file is on the MediaWiki:Bad image list). @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 91
def prop(*values)
  values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
end
sha1(value) click to toggle source

SHA1 hash of image. Overrides aisha1base36.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 128
def sha1(value)
  merge(aisha1: value.to_s)
end
sha1base36(value) click to toggle source

SHA1 hash of image in base 36 (used in MediaWiki).

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 136
def sha1base36(value)
  merge(aisha1base36: value.to_s)
end
sort(value) click to toggle source

Property to sort by.

@param value [String] One of “name”, “timestamp”. @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 25
def sort(value)
  _sort(value) or fail ArgumentError, "Unknown value for sort: #{value}"
end
start(value) click to toggle source

The timestamp to start enumerating from. Can only be used with aisort=timestamp.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 75
def start(value)
  merge(aistart: value.iso8601)
end
to(value) click to toggle source

The image title to stop enumerating at. Can only be used with aisort=name.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 59
def to(value)
  merge(aito: value.to_s)
end
user(value) click to toggle source

Only return files uploaded by this user. Can only be used with aisort=timestamp. Cannot be used together with aifilterbots.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/allimages.rb, line 144
def user(value)
  merge(aiuser: value.to_s)
end