Module: MediaWiktory::Wikipedia::Modules::Deletedrevs

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

Overview

List deleted revisions.

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

#continue(value) ⇒ self

When more results are available, use this to continue.

Parameters:

  • value (String)

Returns:

  • (self)


143
144
145
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 143

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

#dir(value) ⇒ self

In which direction to enumerate:

Parameters:

  • value (String)

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

Returns:

  • (self)


41
42
43
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.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/deletedrevs.rb', line 33

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

#excludeuser(value) ⇒ self

Don't list revisions by this user.

Parameters:

  • value (String)

Returns:

  • (self)


114
115
116
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 114

def excludeuser(value)
  merge(drexcludeuser: value.to_s)
end

#from(value) ⇒ self

Start listing at this title.

Parameters:

  • value (String)

Returns:

  • (self)


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

def from(value)
  merge(drfrom: value.to_s)
end

#limit(value) ⇒ self

The maximum amount of revisions to list.

Parameters:

  • value (Integer, "max")

Returns:

  • (self)


135
136
137
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 135

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

#namespace(value) ⇒ self

Only list pages in this namespace.

Parameters:

  • value (String)

    One of "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)


85
86
87
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 85

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

#prefix(value) ⇒ self

Search for all page titles that begin with this value.

Parameters:

  • value (String)

Returns:

  • (self)


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

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

#prop(*values) ⇒ self

Which properties to get:

Parameters:

  • values (Array<String>)

    Allowed values: "revid" (Adds the revision ID of the deleted revision), "parentid" (Adds the revision ID of the previous revision to the page), "user" (Adds the user who made the revision), "userid" (Adds the ID of the user who made the revision), "comment" (Adds the comment of the revision), "parsedcomment" (Adds the parsed comment of the revision), "minor" (Tags if the revision is minor), "len" (Adds the length (bytes) of the revision), "sha1" (Adds the SHA-1 (base 16) of the revision), "content" (Adds the content of the revision), "token" (Deprecated. Gives the edit token), "tags" (Tags for the revision).

Returns:

  • (self)


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

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/deletedrevs.rb', line 25

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

#tag(value) ⇒ self

Only list revisions tagged with this tag.

Parameters:

  • value (String)

Returns:

  • (self)


98
99
100
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 98

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

#to(value) ⇒ self

Stop listing at this title.

Parameters:

  • value (String)

Returns:

  • (self)


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

def to(value)
  merge(drto: value.to_s)
end

#uniqueself

List only one revision for each page.

Returns:

  • (self)


77
78
79
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 77

def unique()
  merge(drunique: 'true')
end

#user(value) ⇒ self

Only list revisions by this user.

Parameters:

  • value (String)

Returns:

  • (self)


106
107
108
# File 'lib/mediawiktory/wikipedia/modules/deletedrevs.rb', line 106

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