Module: MediaWiktory::Wikipedia::Modules::Checkuser
- Defined in:
- lib/mediawiktory/wikipedia/modules/checkuser.rb
Overview
Check which IP addresses are used by a given username or which usernames are used by a given IP address.
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
-
#limit(value) ⇒ self
Limit of rows.
-
#reason(value) ⇒ self
Reason to check.
-
#request(value) ⇒ self
Type of CheckUser request:.
-
#target(value) ⇒ self
Username, IP address, or CIDR range to check.
-
#timecond(value) ⇒ self
Time limit of user data (like "-2 weeks" or "2 weeks ago").
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
-
#xff(value) ⇒ self
Use XFF data instead of IP address.
Instance Method Details
#limit(value) ⇒ self
Limit of rows.
54 55 56 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 54 def limit(value) merge(culimit: value.to_s) end |
#reason(value) ⇒ self
Reason to check.
46 47 48 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 46 def reason(value) merge(cureason: value.to_s) end |
#request(value) ⇒ self
Type of CheckUser request:
25 26 27 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 25 def request(value) _request(value) or fail ArgumentError, "Unknown value for request: #{value}" end |
#target(value) ⇒ self
Username, IP address, or CIDR range to check.
38 39 40 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 38 def target(value) merge(cutarget: value.to_s) end |
#timecond(value) ⇒ self
Time limit of user data (like "-2 weeks" or "2 weeks ago").
62 63 64 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 62 def timecond(value) merge(cutimecond: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
78 79 80 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 78 def token(value) merge(cutoken: value.to_s) end |
#xff(value) ⇒ self
Use XFF data instead of IP address.
70 71 72 |
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 70 def xff(value) merge(cuxff: value.to_s) end |