Module: MediaWiktory::Wikipedia::Modules::Watchlist
- Defined in:
- lib/mediawiktory/wikipedia/modules/watchlist.rb
Overview
Get recent changes to pages in the current user's watchlist.
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
-
#allrev ⇒ self
Include multiple revisions of the same page within given timeframe.
-
#continue(value) ⇒ self
When more results are available, use this to continue.
-
#dir(value) ⇒ self
In which direction to enumerate:.
-
#end(value) ⇒ self
The timestamp to end enumerating.
-
#excludeuser(value) ⇒ self
Don't list changes by this user.
-
#limit(value) ⇒ self
How many total results to return per request.
-
#namespace(*values) ⇒ self
Filter changes to only the given namespaces.
-
#owner(value) ⇒ self
Used along with wltoken to access a different user's watchlist.
-
#prop(*values) ⇒ self
Which additional properties to get:.
-
#show(*values) ⇒ self
Show only items that meet these criteria.
-
#start(value) ⇒ self
The timestamp to start enumerating from.
-
#token(value) ⇒ self
A security token (available in the user's preferences) to allow access to another user's watchlist.
-
#type(*values) ⇒ self
Which types of changes to show:.
-
#user(value) ⇒ self
Only list changes by this user.
Instance Method Details
#allrev ⇒ self
Include multiple revisions of the same page within given timeframe.
24 25 26 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 24 def allrev() merge(wlallrev: 'true') end |
#continue(value) ⇒ self
When more results are available, use this to continue.
153 154 155 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 153 def continue(value) merge(wlcontinue: value.to_s) end |
#dir(value) ⇒ self
In which direction to enumerate:
77 78 79 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 77 def dir(value) _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}" end |
#end(value) ⇒ self
The timestamp to end enumerating.
40 41 42 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 40 def end(value) merge(wlend: value.iso8601) end |
#excludeuser(value) ⇒ self
Don't list changes by this user.
69 70 71 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 69 def excludeuser(value) merge(wlexcludeuser: value.to_s) end |
#limit(value) ⇒ self
How many total results to return per request.
90 91 92 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 90 def limit(value) merge(wllimit: value.to_s) end |
#namespace(*values) ⇒ self
Filter changes to only the given namespaces.
48 49 50 |
# File 'lib/mediawiktory/wikipedia/modules/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) ⇒ self
Used along with wltoken to access a different user's watchlist.
137 138 139 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 137 def owner(value) merge(wlowner: value.to_s) end |
#prop(*values) ⇒ self
Which additional properties to get:
98 99 100 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 98 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. For example, to see only minor edits done by logged-in users, set wlshow=minor|!anon.
111 112 113 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 111 def show(*values) values.inject(self) { |res, val| res._show(val) or fail ArgumentError, "Unknown value for show: #{val}" } end |
#start(value) ⇒ self
The timestamp to start enumerating from.
32 33 34 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 32 def start(value) merge(wlstart: value.iso8601) end |
#token(value) ⇒ self
A security token (available in the user's preferences) to allow access to another user's watchlist.
145 146 147 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 145 def token(value) merge(wltoken: value.to_s) end |
#type(*values) ⇒ self
Which types of changes to show:
124 125 126 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 124 def type(*values) values.inject(self) { |res, val| res._type(val) or fail ArgumentError, "Unknown value for type: #{val}" } end |
#user(value) ⇒ self
Only list changes by this user.
61 62 63 |
# File 'lib/mediawiktory/wikipedia/modules/watchlist.rb', line 61 def user(value) merge(wluser: value.to_s) end |