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

Instance Method Details

#limit(value) ⇒ self

Limit of rows.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


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.

Parameters:

  • value (String)

Returns:

  • (self)


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:

Parameters:

  • value (String)

    One of "userips" (Get IP address of target user), "edits" (Get changes from target IP address or range), "ipusers" (Get users from target IP address or range).

Returns:

  • (self)


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.

Parameters:

  • value (String)

Returns:

  • (self)


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").

Parameters:

  • value (String)

Returns:

  • (self)


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

Parameters:

  • value (String)

Returns:

  • (self)


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.

Parameters:

  • value (String)

Returns:

  • (self)


70
71
72
# File 'lib/mediawiktory/wikipedia/modules/checkuser.rb', line 70

def xff(value)
  merge(cuxff: value.to_s)
end