api-call ( params -- assoc ) (original) (raw)
Inputs
params | an assoc of API parameters |
---|
Outputs
assoc | a parsed JSON result |
---|
Word description
Makes a call to a MediaWiki API. Retries on certain errorconditions. Uses a maxlag value of 5 and, in the case ofreplication lag, pauses for the amount of time specified by theAPI. Pauses 10 minutes on non-200 status codes and 5 minuteswhen the database is set to readonly. Prints debug informationon non-200 status codes and JSON parse failure. Prints APIwarnings and errors.
Examples
USING: locals mediawiki.api ; { { "meta" "tokens" } { "type" "watch" } } query "watchtoken" of [| token | { { "action" "watch" } { "titles" { "Volkswagen Beetle" "Factor (programming language)" } } { "token" token } } api-call ] call drop
Definition