Module: MediaWiktory::Wikipedia::Modules::Usercontribs
- Defined in:
- lib/mediawiktory/wikipedia/modules/usercontribs.rb
Overview
Get all edits by a user.
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
In which direction to enumerate:.
-
#end(value) ⇒ self
The end timestamp to return to.
-
#limit(value) ⇒ self
The maximum number of contributions to return.
-
#namespace(*values) ⇒ self
Only list contributions in these namespaces.
-
#prop(*values) ⇒ self
Include additional pieces of information:.
-
#show(*values) ⇒ self
Show only items that meet these criteria, e.g.
-
#start(value) ⇒ self
The start timestamp to return from.
-
#tag(value) ⇒ self
Only list revisions tagged with this tag.
-
#toponly ⇒ self
Only list changes which are the latest revision.
-
#user(*values) ⇒ self
The users to retrieve contributions for.
-
#userids(*values) ⇒ self
The user IDs to retrieve contributions for.
-
#userprefix(value) ⇒ self
Retrieve contributions for all users whose names begin with this value.
Instance Method Details
#continue(value) ⇒ self
When more results are available, use this to continue.
49 50 51 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 49 def continue(value) merge(uccontinue: value.to_s) end |
#dir(value) ⇒ self
In which direction to enumerate:
91 92 93 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 91 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#end(value) ⇒ self
The end timestamp to return to.
41 42 43 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 41 def end(value) merge(ucend: value.iso8601) end |
#limit(value) ⇒ self
The maximum number of contributions to return.
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 25 def limit(value) merge(uclimit: value.to_s) end |
#namespace(*values) ⇒ self
Only list contributions in these namespaces.
104 105 106 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 104 def namespace(*values) values.inject(self) { |res, val| res._namespace(val) or fail ArgumentError, "Unknown value for namespace: #{val}" } end |
#prop(*values) ⇒ self
Include additional pieces of information:
117 118 119 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 117 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#show(*values) ⇒ self
Show only items that meet these criteria, e.g. non minor edits only: ucshow=!minor.
130 131 132 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 130 def show(*values) values.inject(self) { |res, val| res._show(val) or fail ArgumentError, "Unknown value for show: #{val}" } end |
#start(value) ⇒ self
The start timestamp to return from.
33 34 35 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 33 def start(value) merge(ucstart: value.iso8601) end |
#tag(value) ⇒ self
Only list revisions tagged with this tag.
143 144 145 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 143 def tag(value) merge(uctag: value.to_s) end |
#toponly ⇒ self
Only list changes which are the latest revision.
150 151 152 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 150 def toponly() merge(uctoponly: 'true') end |
#user(*values) ⇒ self
The users to retrieve contributions for. Cannot be used with ucuserids or ucuserprefix.
57 58 59 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 57 def user(*values) values.inject(self) { |res, val| res._user(val) } end |
#userids(*values) ⇒ self
The user IDs to retrieve contributions for. Cannot be used with ucuser or ucuserprefix.
70 71 72 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 70 def userids(*values) values.inject(self) { |res, val| res._userids(val) } end |
#userprefix(value) ⇒ self
Retrieve contributions for all users whose names begin with this value. Cannot be used with ucuser or ucuserids.
83 84 85 |
# File 'lib/mediawiktory/wikipedia/modules/usercontribs.rb', line 83 def userprefix(value) merge(ucuserprefix: value.to_s) end |