Class: MediaWiktory::Wikipedia::Actions::Visualeditoredit
- Defined in:
- lib/mediawiktory/wikipedia/actions/visualeditoredit.rb
Overview
Save an HTML5 page to MediaWiki (converted to wikitext via the Parsoid service).
Usage:
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 Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#basetimestamp(value) ⇒ self
When saving, set this to the timestamp of the revision that was edited.
-
#cachekey(value) ⇒ self
Use the result of a previous serializeforcache request with this key.
-
#captchaid(value) ⇒ self
Captcha ID (when saving with a captcha response).
-
#captchaword(value) ⇒ self
Answer to the captcha (when saving with a captcha response).
-
#etag(value) ⇒ self
ETag to send.
-
#html(value) ⇒ self
HTML to send to Parsoid in exchange for wikitext.
-
#minor(value) ⇒ self
Flag for minor edit.
-
#oldid(value) ⇒ self
The revision number to use.
-
#paction(value) ⇒ self
Action to perform.
-
#page(value) ⇒ self
The page to perform actions on.
-
#section(value) ⇒ self
The section on which to act.
-
#sectiontitle(value) ⇒ self
Title for new section.
-
#starttimestamp(value) ⇒ self
When saving, set this to the timestamp of when the page was loaded.
-
#summary(value) ⇒ self
Edit summary.
-
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens.
- #watch(value) ⇒ self
- #wikitext(value) ⇒ self
Methods inherited from Post
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#basetimestamp(value) ⇒ self
When saving, set this to the timestamp of the revision that was edited. Used to detect edit conflicts.
79 80 81 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 79 def (value) merge(basetimestamp: value.to_s) end |
#cachekey(value) ⇒ self
Use the result of a previous serializeforcache request with this key. Overrides html.
159 160 161 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 159 def cachekey(value) merge(cachekey: value.to_s) end |
#captchaid(value) ⇒ self
Captcha ID (when saving with a captcha response).
143 144 145 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 143 def captchaid(value) merge(captchaid: value.to_s) end |
#captchaword(value) ⇒ self
Answer to the captcha (when saving with a captcha response).
151 152 153 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 151 def captchaword(value) merge(captchaword: value.to_s) end |
#etag(value) ⇒ self
ETag to send.
127 128 129 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 127 def etag(value) merge(etag: value.to_s) end |
#html(value) ⇒ self
HTML to send to Parsoid in exchange for wikitext.
119 120 121 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 119 def html(value) merge(html: value.to_s) end |
#minor(value) ⇒ self
Flag for minor edit.
103 104 105 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 103 def minor(value) merge(minor: value.to_s) end |
#oldid(value) ⇒ self
The revision number to use. Defaults to latest revision. Use 0 for a new page.
95 96 97 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 95 def oldid(value) merge(oldid: value.to_s) end |
#paction(value) ⇒ self
Action to perform.
26 27 28 |
# 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) ⇒ self
The page to perform actions on.
39 40 41 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 39 def page(value) merge(page: value.to_s) end |
#section(value) ⇒ self
The section on which to act.
63 64 65 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 63 def section(value) merge(section: value.to_s) end |
#sectiontitle(value) ⇒ self
Title for new section.
71 72 73 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 71 def sectiontitle(value) merge(sectiontitle: value.to_s) end |
#starttimestamp(value) ⇒ self
When saving, set this to the timestamp of when the page was loaded. Used to detect edit conflicts.
87 88 89 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 87 def (value) merge(starttimestamp: value.to_s) end |
#summary(value) ⇒ self
Edit summary.
135 136 137 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 135 def summary(value) merge(summary: value.to_s) end |
#token(value) ⇒ self
A "csrf" token retrieved from action=query&meta=tokens
47 48 49 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 47 def token(value) merge(token: value.to_s) end |
#watch(value) ⇒ self
111 112 113 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 111 def watch(value) merge(watch: value.to_s) end |
#wikitext(value) ⇒ self
55 56 57 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditoredit.rb', line 55 def wikitext(value) merge(wikitext: value.to_s) end |