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
@private
# 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
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
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
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
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 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 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
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
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
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
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
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
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
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
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
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
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 111 def watch(value) merge(watch: value.to_s) end
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditoredit.rb, line 55 def wikitext(value) merge(wikitext: value.to_s) end