class MediaWiktory::Wikipedia::Actions::Visualeditoredit

Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).

Usage:

“`ruby api.visualeditoredit.paction(value).perform # returns string with raw output # or api.visualeditoredit.paction(value).response # returns output parsed and wrapped into Response object “`

See {Base} for generic explanation of working with MediaWiki actions and {MediaWiktory::Wikipedia::Response} for working with action responses.

All action's parameters are documented as its public methods, see below.

Public Instance Methods

_paction(value) click to toggle source

@private

Calls superclass method
# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 31
def _paction(value)
  defined?(super) && super || ["serialize", "serializeforcache", "diff", "save"].include?(value.to_s) && merge(paction: value.to_s)
end
basetimestamp(value) click to toggle source

When saving, set this to the timestamp of the revision that was edited. Used to detect edit conflicts.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 79
def basetimestamp(value)
  merge(basetimestamp: value.to_s)
end
cachekey(value) click to toggle source

Use the result of a previous serializeforcache request with this key. Overrides html.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 159
def cachekey(value)
  merge(cachekey: value.to_s)
end
captchaid(value) click to toggle source

Captcha ID (when saving with a captcha response).

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 143
def captchaid(value)
  merge(captchaid: value.to_s)
end
captchaword(value) click to toggle source

Answer to the captcha (when saving with a captcha response).

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 151
def captchaword(value)
  merge(captchaword: value.to_s)
end
etag(value) click to toggle source

ETag to send.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 127
def etag(value)
  merge(etag: value.to_s)
end
html(value) click to toggle source

HTML to send to Parsoid in exchange for wikitext.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 119
def html(value)
  merge(html: value.to_s)
end
minor(value) click to toggle source

Flag for minor edit.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 103
def minor(value)
  merge(minor: value.to_s)
end
oldid(value) click to toggle source

The revision number to use. Defaults to latest revision. Use 0 for a new page.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 95
def oldid(value)
  merge(oldid: value.to_s)
end
paction(value) click to toggle source

Action to perform.

@param value [String] One of “serialize”, “serializeforcache”, “diff”, “save”. @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 26
def paction(value)
  _paction(value) or fail ArgumentError, "Unknown value for paction: #{value}"
end
page(value) click to toggle source

The page to perform actions on.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 39
def page(value)
  merge(page: value.to_s)
end
section(value) click to toggle source

The section on which to act.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 63
def section(value)
  merge(section: value.to_s)
end
sectiontitle(value) click to toggle source

Title for new section.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 71
def sectiontitle(value)
  merge(sectiontitle: value.to_s)
end
starttimestamp(value) click to toggle source

When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 87
def starttimestamp(value)
  merge(starttimestamp: value.to_s)
end
summary(value) click to toggle source

Edit summary.

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 135
def summary(value)
  merge(summary: value.to_s)
end
token(value) click to toggle source

A “csrf” token retrieved from action=query&meta=tokens

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 47
def token(value)
  merge(token: value.to_s)
end
watch(value) click to toggle source

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 111
def watch(value)
  merge(watch: value.to_s)
end
wikitext(value) click to toggle source

@param value [String] @return [self]

# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 55
def wikitext(value)
  merge(wikitext: value.to_s)
end