Module: MediaWiktory::Wikipedia::Modules::Allimages
- Defined in:
- lib/mediawiktory/wikipedia/modules/allimages.rb
Overview
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 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
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#dir(value) ⇒ self
The direction in which to list.
-
#end(value) ⇒ self
The timestamp to end enumerating.
-
#filterbots(value) ⇒ self
How to filter files uploaded by bots.
-
#from(value) ⇒ self
The image title to start enumerating from.
-
#limit(value) ⇒ self
How many images in total to return.
-
#maxsize(value) ⇒ self
Limit to images with at most this many bytes.
-
#mime(*values) ⇒ self
Disabled due to miser mode.
-
#minsize(value) ⇒ self
Limit to images with at least this many bytes.
-
#prefix(value) ⇒ self
Search for all image titles that begin with this value.
-
#prop(*values) ⇒ self
Which file information to get:.
-
#sha1(value) ⇒ self
SHA1 hash of image.
-
#sha1base36(value) ⇒ self
SHA1 hash of image in base 36 (used in MediaWiki).
-
#sort(value) ⇒ self
Property to sort by.
-
#start(value) ⇒ self
The timestamp to start enumerating from.
-
#to(value) ⇒ self
The image title to stop enumerating at.
-
#user(value) ⇒ self
Only return files uploaded by this user.
Instance Method Details
#continue(value) ⇒ self
When more results are available, use this to continue.
67 68 69 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 67 def continue(value) merge(aicontinue: value.to_s) end |
#dir(value) ⇒ self
The direction in which to list.
38 39 40 |
# 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) ⇒ self
The timestamp to end enumerating. Can only be used with aisort=timestamp.
83 84 85 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 83 def end(value) merge(aiend: value.iso8601) end |
#filterbots(value) ⇒ self
How to filter files uploaded by bots. Can only be used with aisort=timestamp. Cannot be used together with aiuser.
152 153 154 |
# 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) ⇒ self
The image title to start enumerating from. Can only be used with aisort=name.
51 52 53 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 51 def from(value) merge(aifrom: value.to_s) end |
#limit(value) ⇒ self
How many images in total to return.
178 179 180 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 178 def limit(value) merge(ailimit: value.to_s) end |
#maxsize(value) ⇒ self
Limit to images with at most this many bytes.
120 121 122 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 120 def maxsize(value) merge(aimaxsize: value.to_s) end |
#mime(*values) ⇒ self
Disabled due to miser mode.
165 166 167 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 165 def mime(*values) values.inject(self) { |res, val| res._mime(val) } end |
#minsize(value) ⇒ self
Limit to images with at least this many bytes.
112 113 114 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 112 def minsize(value) merge(aiminsize: value.to_s) end |
#prefix(value) ⇒ self
Search for all image titles that begin with this value. Can only be used with aisort=name.
104 105 106 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 104 def prefix(value) merge(aiprefix: value.to_s) end |
#prop(*values) ⇒ self
Which file information to get:
91 92 93 |
# 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) ⇒ self
SHA1 hash of image. Overrides aisha1base36.
128 129 130 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 128 def sha1(value) merge(aisha1: value.to_s) end |
#sha1base36(value) ⇒ self
SHA1 hash of image in base 36 (used in MediaWiki).
136 137 138 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 136 def sha1base36(value) merge(aisha1base36: value.to_s) end |
#sort(value) ⇒ self
Property to sort by.
25 26 27 |
# 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) ⇒ self
The timestamp to start enumerating from. Can only be used with aisort=timestamp.
75 76 77 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 75 def start(value) merge(aistart: value.iso8601) end |
#to(value) ⇒ self
The image title to stop enumerating at. Can only be used with aisort=name.
59 60 61 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 59 def to(value) merge(aito: value.to_s) end |
#user(value) ⇒ self
Only return files uploaded by this user. Can only be used with aisort=timestamp. Cannot be used together with aifilterbots.
144 145 146 |
# File 'lib/mediawiktory/wikipedia/modules/allimages.rb', line 144 def user(value) merge(aiuser: value.to_s) end |