Module: MediaWiktory::Wikipedia::Modules::Abuselog

Defined in:
lib/mediawiktory/wikipedia/modules/abuselog.rb

Overview

Show events that were caught by one of the abuse filters.

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

#dir(value) ⇒ self

In which direction to enumerate:

Parameters:

  • value (String)

    One of "newer" (List oldest first. Note: aflstart has to be before aflend), "older" (List newest first (default). Note: aflstart has to be later than aflend).

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 41

def dir(value)
  _dir(value) or fail ArgumentError, "Unknown value for dir: #{value}"
end

#end(value) ⇒ self

The timestamp to stop enumerating at.

Parameters:

  • value (Time)

Returns:

  • (self)


33
34
35
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 33

def end(value)
  merge(aflend: value.iso8601)
end

#filter(*values) ⇒ self

Show only entries that were caught by a given filter ID.

Parameters:

  • values (Array<String>)

Returns:

  • (self)


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

def filter(*values)
  values.inject(self) { |res, val| res._filter(val) }
end

#limit(value) ⇒ self

The maximum amount of entries to list.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


83
84
85
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 83

def limit(value)
  merge(afllimit: value.to_s)
end

#prop(*values) ⇒ self

Which properties to get.

Parameters:

  • values (Array<String>)

    Allowed values: "ids", "filter", "user", "ip", "title", "action", "details", "result", "timestamp", "hidden", "revid".

Returns:

  • (self)


91
92
93
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 91

def prop(*values)
  values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
end

#start(value) ⇒ self

The timestamp to start enumerating from.

Parameters:

  • value (Time)

Returns:

  • (self)


25
26
27
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 25

def start(value)
  merge(aflstart: value.iso8601)
end

#title(value) ⇒ self

Show only entries occurring on a given page.

Parameters:

  • value (String)

Returns:

  • (self)


62
63
64
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 62

def title(value)
  merge(afltitle: value.to_s)
end

#user(value) ⇒ self

Show only entries done by a given user or IP address.

Parameters:

  • value (String)

Returns:

  • (self)


54
55
56
# File 'lib/mediawiktory/wikipedia/modules/abuselog.rb', line 54

def user(value)
  merge(afluser: value.to_s)
end