module MediaWiktory::Wikipedia::Modules::GWatchlist

Get recent changes to pages in the current user's watchlist. _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 {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/g-watchlist.rb, line 82
def _dir(value)
  defined?(super) && super || ["newer", "older"].include?(value.to_s) && merge(gwldir: value.to_s)
end
_namespace(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 53
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(gwlnamespace: value.to_s, replace: false)
end
_show(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 103
def _show(value)
  defined?(super) && super || ["minor", "!minor", "bot", "!bot", "anon", "!anon", "patrolled", "!patrolled", "unread", "!unread"].include?(value.to_s) && merge(gwlshow: value.to_s, replace: false)
end
_type(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 116
def _type(value)
  defined?(super) && super || ["edit", "new", "log", "external", "categorize"].include?(value.to_s) && merge(gwltype: value.to_s, replace: false)
end
allrev() click to toggle source

Include multiple revisions of the same page within given timeframe.

@return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 24
def allrev()
  merge(gwlallrev: 'true')
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/g-watchlist.rb, line 140
def continue(value)
  merge(gwlcontinue: 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: wlstart has to be before wlend), “older” (List newest first (default). Note: wlstart has to be later than wlend). @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 77
def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end
end(value) click to toggle source

The timestamp to end enumerating.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 40
def end(value)
  merge(gwlend: value.iso8601)
end
excludeuser(value) click to toggle source

Don't list changes by this user.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 69
def excludeuser(value)
  merge(gwlexcludeuser: value.to_s)
end
limit(value) click to toggle source

How many total results to return per request.

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

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 90
def limit(value)
  merge(gwllimit: value.to_s)
end
namespace(*values) click to toggle source

Filter changes to only the given 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/g-watchlist.rb, line 48
def namespace(*values)
  values.inject(self) { |res, val| res._namespace(val) or fail ArgumentError, "Unknown value for namespace: #{val}" }
end
owner(value) click to toggle source

Used along with wltoken to access a different user's watchlist.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 124
def owner(value)
  merge(gwlowner: value.to_s)
end
show(*values) click to toggle source

Show only items that meet these criteria. For example, to see only minor edits done by logged-in users, set wlshow=minor|!anon.

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

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 98
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 timestamp to start enumerating from.

@param value [Time] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 32
def start(value)
  merge(gwlstart: value.iso8601)
end
token(value) click to toggle source

A security token (available in the user's preferences) to allow access to another user's watchlist.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 132
def token(value)
  merge(gwltoken: value.to_s)
end
type(*values) click to toggle source

Which types of changes to show:

@param values [Array<String>] Allowed values: “edit” (Regular page edits), “new” (Page creations), “log” (Log entries), “external” (External changes), “categorize” (Category membership changes). @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 111
def type(*values)
  values.inject(self) { |res, val| res._type(val) or fail ArgumentError, "Unknown value for type: #{val}" }
end
user(value) click to toggle source

Only list changes by this user.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/modules/g-watchlist.rb, line 61
def user(value)
  merge(gwluser: value.to_s)
end