Module: MediaWiktory::Wikipedia::Modules::Filearchive

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

Overview

Enumerate all deleted files sequentially.

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)


99
100
101
# File 'lib/mediawiktory/wikipedia/modules/filearchive.rb', line 99

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

#dir(value) ⇒ self

The direction in which to list.

Parameters:

  • value (String)

    One of "ascending", "descending".

Returns:

  • (self)


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

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

#from(value) ⇒ self

The image title to start enumerating from.

Parameters:

  • value (String)

Returns:

  • (self)


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

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

#limit(value) ⇒ self

How many images to return in total.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


91
92
93
# File 'lib/mediawiktory/wikipedia/modules/filearchive.rb', line 91

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

#prefix(value) ⇒ self

Search for all image titles that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


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

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

#prop(*values) ⇒ self

Which image information to get:

Parameters:

  • values (Array<String>)

    Allowed values: "sha1" (Adds SHA-1 hash for the image), "timestamp" (Adds timestamp for the uploaded version), "user" (Adds user who uploaded the image version), "size" (Adds the size of the image in bytes and the height, width and page count (if applicable)), "dimensions" (Alias for size), "description" (Adds description of the image version), "parseddescription" (Parse the description of the version), "mime" (Adds MIME of the image), "mediatype" (Adds the media type of the image), "metadata" (Lists Exif metadata for the version of the image), "bitdepth" (Adds the bit depth of the version), "archivename" (Adds the filename of the archive version for non-latest versions).

Returns:

  • (self)


78
79
80
# File 'lib/mediawiktory/wikipedia/modules/filearchive.rb', line 78

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

#sha1(value) ⇒ self

SHA1 hash of image. Overrides fasha1base36.

Parameters:

  • value (String)

Returns:

  • (self)


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

def sha1(value)
  merge(fasha1: value.to_s)
end

#sha1base36(value) ⇒ self

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

Parameters:

  • value (String)

Returns:

  • (self)


70
71
72
# File 'lib/mediawiktory/wikipedia/modules/filearchive.rb', line 70

def sha1base36(value)
  merge(fasha1base36: value.to_s)
end

#to(value) ⇒ self

The image title to stop enumerating at.

Parameters:

  • value (String)

Returns:

  • (self)


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

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