Module: MediaWiktory::Wikipedia::Modules::Logevents

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

Overview

Get events from logs.

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

#action(value) ⇒ self

Filter log actions to only this action. Overrides letype. In the list of possible values, values with the asterisk wildcard such as action/* can have different strings after the slash (/).

Parameters:

  • value (String)

    One of "gblblock/gblock", "gblblock/gblock2", "gblblock/gunblock", "gblblock/modify", "globalauth/delete", "globalauth/lock", "globalauth/unlock", "globalauth/hide", "globalauth/unhide", "globalauth/lockandhid", "globalauth/setstatus", "suppress/setstatus", "suppress/cadelete", "gblrights/usergroups", "gblrights/groupperms", "gblrights/groupprms2", "gblrights/groupprms3", "suppress/hide-afl", "suppress/unhide-afl", "usermerge/mergeuser", "usermerge/deleteuser", "rights/erevoke", "spamblacklist/", "titleblacklist/", "gblblock/whitelist", "gblblock/dwhitelist", "renameuser/renameuser", "gblrights/grouprename", "gblrename/rename", "gblrename/promote", "gblrename/merge", "gblrights/newset", "gblrights/setrename", "gblrights/setnewtype", "gblrights/setchange", "gblrights/deleteset", "abusefilter/modify", "abusefilter/hit", "massmessage/", "massmessage/send", "massmessage/failure", "massmessage/skipoptout", "massmessage/skipnouser", "massmessage/skipbadns", "pagetriage-curation/reviewed", "pagetriage-curation/unreviewed", "pagetriage-curation/tag", "pagetriage-curation/delete", "pagetriage-deletion/delete", "institution/", "course/", "student/", "student/add", "student/remove", "online/", "online/add", "online/remove", "campus/", "campus/add", "campus/remove", "instructor/", "instructor/add", "instructor/remove", "eparticle/", "thanks/*", "block/block", "block/reblock", "block/unblock", "contentmodel/change", "contentmodel/new", "delete/delete", "delete/delete_redir", "delete/event", "delete/restore", "delete/revision", "import/interwiki", "import/upload", "managetags/activate", "managetags/create", "managetags/deactivate", "managetags/delete", "merge/merge", "move/move", "move/move_redir", "patrol/patrol", "patrol/autopatrol", "protect/modify", "protect/move_prot", "protect/protect", "protect/unprotect", "rights/autopromote", "rights/rights", "suppress/block", "suppress/delete", "suppress/event", "suppress/reblock", "suppress/revision", "tag/update", "upload/overwrite", "upload/revert", "upload/upload", "review/approve", "review/approve2", "review/approve-i", "review/approve2-i", "review/approve-a", "review/approve2-a", "review/approve-ia", "review/approve2-ia", "review/unapprove", "review/unapprove2", "stable/config", "stable/modify", "stable/reset", "stable/move_stable", "timedmediahandler/resettranscode", "newusers/newusers", "newusers/create", "newusers/create2", "newusers/byemail", "newusers/autocreate".

Returns:

  • (self)


51
52
53
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 51

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

#continue(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (String)

Returns:

  • (self)


146
147
148
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 146

def continue(value)
  merge(lecontinue: value.to_s)
end

#dir(value) ⇒ self

In which direction to enumerate:

Parameters:

  • value (String)

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

Returns:

  • (self)


80
81
82
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 80

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

#end(value) ⇒ self

The timestamp to end enumerating.

Parameters:

  • value (Time)

Returns:

  • (self)


72
73
74
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 72

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

#limit(value) ⇒ self

How many total event entries to return.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


138
139
140
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 138

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

#namespace(value) ⇒ self

Filter entries to those in the given namespace.

Parameters:

  • value (String)

    One of "-2", "-1", "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".

Returns:

  • (self)


109
110
111
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 109

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

#prefix(value) ⇒ self

Disabled due to miser mode.

Parameters:

  • value (String)

Returns:

  • (self)


122
123
124
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 122

def prefix(value)
  merge(leprefix: value.to_s)
end

#prop(*values) ⇒ self

Which properties to get:

Parameters:

  • values (Array<String>)

    Allowed values: "ids" (Adds the ID of the log event), "title" (Adds the title of the page for the log event), "type" (Adds the type of log event), "user" (Adds the user responsible for the log event), "userid" (Adds the user ID who was responsible for the log event), "timestamp" (Adds the timestamp for the log event), "comment" (Adds the comment of the log event), "parsedcomment" (Adds the parsed comment of the log event), "details" (Lists additional details about the log event), "tags" (Lists tags for the log event).

Returns:

  • (self)


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

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)


64
65
66
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 64

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

#tag(value) ⇒ self

Only list event entries tagged with this tag.

Parameters:

  • value (String)

Returns:

  • (self)


130
131
132
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 130

def tag(value)
  merge(letag: value.to_s)
end

#title(value) ⇒ self

Filter entries to those related to a page.

Parameters:

  • value (String)

Returns:

  • (self)


101
102
103
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 101

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

#type(value) ⇒ self

Filter log entries to only this type.

Parameters:

  • value (String)

    One of "spamblacklist", "titleblacklist", "gblblock", "renameuser", "globalauth", "gblrights", "gblrename", "abusefilter", "massmessage", "pagetriage-curation", "pagetriage-deletion", "institution", "course", "student", "online", "campus", "instructor", "thanks", "usermerge", "block", "protect", "rights", "delete", "upload", "move", "import", "patrol", "merge", "suppress", "tag", "managetags", "contentmodel", "review", "stable", "timedmediahandler", "newusers".

Returns:

  • (self)


38
39
40
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 38

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

#user(value) ⇒ self

Filter entries to those made by the given user.

Parameters:

  • value (String)

Returns:

  • (self)


93
94
95
# File 'lib/mediawiktory/wikipedia/modules/logevents.rb', line 93

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