Module: MediaWiktory::Wikipedia::Modules::GAllimages
- Defined in:
- lib/mediawiktory/wikipedia/modules/g-allimages.rb
Overview
Enumerate all images sequentially. 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
-
#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.
-
#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/g-allimages.rb', line 67 def continue(value) merge(gaicontinue: value.to_s) end |
#dir(value) ⇒ self
The direction in which to list.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/g-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/g-allimages.rb', line 83 def end(value) merge(gaiend: 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.
139 140 141 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 139 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/g-allimages.rb', line 51 def from(value) merge(gaifrom: value.to_s) end |
#limit(value) ⇒ self
How many images in total to return.
165 166 167 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 165 def limit(value) merge(gailimit: value.to_s) end |
#maxsize(value) ⇒ self
Limit to images with at most this many bytes.
107 108 109 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 107 def maxsize(value) merge(gaimaxsize: value.to_s) end |
#mime(*values) ⇒ self
Disabled due to miser mode.
152 153 154 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 152 def mime(*values) values.inject(self) { |res, val| res._mime(val) } end |
#minsize(value) ⇒ self
Limit to images with at least this many bytes.
99 100 101 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 99 def minsize(value) merge(gaiminsize: value.to_s) end |
#prefix(value) ⇒ self
Search for all image titles that begin with this value. Can only be used with aisort=name.
91 92 93 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 91 def prefix(value) merge(gaiprefix: value.to_s) end |
#sha1(value) ⇒ self
SHA1 hash of image. Overrides aisha1base36.
115 116 117 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 115 def sha1(value) merge(gaisha1: value.to_s) end |
#sha1base36(value) ⇒ self
SHA1 hash of image in base 36 (used in MediaWiki).
123 124 125 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 123 def sha1base36(value) merge(gaisha1base36: value.to_s) end |
#sort(value) ⇒ self
Property to sort by.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/g-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/g-allimages.rb', line 75 def start(value) merge(gaistart: 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/g-allimages.rb', line 59 def to(value) merge(gaito: 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.
131 132 133 |
# File 'lib/mediawiktory/wikipedia/modules/g-allimages.rb', line 131 def user(value) merge(gaiuser: value.to_s) end |