module MediaWiktory::Wikipedia::Modules::Usercontribs

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 {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/usercontribs.rb, line 96
def _dir(value)
  defined?(super) && super || ["newer", "older"].include?(value.to_s) && merge(ucdir: value.to_s)
end
_namespace(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 109
def _namespace(value)
  defined?(super) && super || ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "100", "101", "108", "109", "118", "119", "446", "447", "710", "711", "828", "829", "2300", "2301", "2302", "2303"].include?(value.to_s) && merge(ucnamespace: value.to_s, replace: false)
end
_prop(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 122
def _prop(value)
  defined?(super) && super || ["ids", "title", "timestamp", "comment", "parsedcomment", "size", "sizediff", "flags", "patrolled", "tags"].include?(value.to_s) && merge(ucprop: value.to_s, replace: false)
end
_show(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 135
def _show(value)
  defined?(super) && super || ["minor", "!minor", "patrolled", "!patrolled", "top", "!top", "new", "!new"].include?(value.to_s) && merge(ucshow: value.to_s, replace: false)
end
_user(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 62
def _user(value)
  merge(ucuser: value.to_s, replace: false)
end
_userids(value) click to toggle source

@private

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 75
def _userids(value)
  merge(ucuserids: value.to_s, replace: false)
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/usercontribs.rb, line 49
def continue(value)
  merge(uccontinue: value.to_s)
end
dir(value) click to toggle source

In which direction to enumerate:

@param value [String] One of “newer” (List oldest first. Note: ucstart has to be before ucend), “older” (List newest first (default). Note: ucstart has to be later than ucend). @return [self]

# 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) click to toggle source

The end timestamp to return to.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 41
def end(value)
  merge(ucend: value.iso8601)
end
limit(value) click to toggle source

The maximum number of contributions to return.

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

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 25
def limit(value)
  merge(uclimit: value.to_s)
end
namespace(*values) click to toggle source

Only list contributions in these namespaces.

@param values [Array<String>] Allowed values: “0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “11”, “12”, “13”, “14”, “15”, “100”, “101”, “108”, “109”, “118”, “119”, “446”, “447”, “710”, “711”, “828”, “829”, “2300”, “2301”, “2302”, “2303”. @return [self]

# 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) click to toggle source

Include additional pieces of information:

@param values [Array<String>] Allowed values: “ids” (Adds the page ID and revision ID), “title” (Adds the title and namespace ID of the page), “timestamp” (Adds the timestamp of the edit), “comment” (Adds the comment of the edit), “parsedcomment” (Adds the parsed comment of the edit), “size” (Adds the new size of the edit), “sizediff” (Adds the size delta of the edit against its parent), “flags” (Adds flags of the edit), “patrolled” (Tags patrolled edits), “tags” (Lists tags for the edit). @return [self]

# 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) click to toggle source

Show only items that meet these criteria, e.g. non minor edits only: ucshow=!minor.

@param values [Array<String>] Allowed values: “minor”, “!minor”, “patrolled”, “!patrolled”, “top”, “!top”, “new”, “!new”. @return [self]

# 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) click to toggle source

The start timestamp to return from.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 33
def start(value)
  merge(ucstart: value.iso8601)
end
tag(value) click to toggle source

Only list revisions tagged with this tag.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 143
def tag(value)
  merge(uctag: value.to_s)
end
toponly() click to toggle source

Only list changes which are the latest revision.

@return [self]

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 150
def toponly()
  merge(uctoponly: 'true')
end
user(*values) click to toggle source

The users to retrieve contributions for. Cannot be used with ucuserids or ucuserprefix.

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

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 57
def user(*values)
  values.inject(self) { |res, val| res._user(val) }
end
userids(*values) click to toggle source

The user IDs to retrieve contributions for. Cannot be used with ucuser or ucuserprefix.

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

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 70
def userids(*values)
  values.inject(self) { |res, val| res._userids(val) }
end
userprefix(value) click to toggle source

Retrieve contributions for all users whose names begin with this value. Cannot be used with ucuser or ucuserids.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/usercontribs.rb, line 83
def userprefix(value)
  merge(ucuserprefix: value.to_s)
end