From: Giftpflanze Date: Sun, 27 Mar 2022 19:59:10 +0000 (+0200) Subject: mediawiki.api: Fix documentation, improvements X-Git-Tag: 0.99~1466 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=eb19fc04b2b2c5aace755342122a93fac3b7e6ec mediawiki.api: Fix documentation, improvements --- diff --git a/extra/mediawiki/api/api-docs.factor b/extra/mediawiki/api/api-docs.factor index 289da60adf..bbb01cf531 100644 --- a/extra/mediawiki/api/api-docs.factor +++ b/extra/mediawiki/api/api-docs.factor @@ -108,7 +108,7 @@ $nl "{" " { \"action\" \"query\" }" " { \"list\" \"watchlistraw\" }" -"} api-query" +"} api-call" "\"watchlistraw\" of" } { $code " { { \"list\" \"watchlistraw\" } } query" } } ; diff --git a/extra/mediawiki/api/api.factor b/extra/mediawiki/api/api.factor index bff09f613f..04b9634fb0 100644 --- a/extra/mediawiki/api/api.factor +++ b/extra/mediawiki/api/api.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2021 Giftpflanze. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays accessors assocs calendar combinators -continuations formatting http http.client io json.reader kernel -locals make math math.parser namespaces oauth1 prettyprint -sequences strings system threads ; +USING: arrays accessors assocs assocs.extras calendar +combinators continuations formatting http http.client io +json.reader kernel locals make math math.parser namespaces +oauth1 prettyprint sequences strings system threads ; IN: mediawiki.api TUPLE: oauth-login consumer-token consumer-secret access-token @@ -13,8 +13,14 @@ TUPLE: password-login username password ; C: oauth-login C: password-login -SYMBOLS: basetimestamp endpoint botflag contact cookies -curtimestamp oauth-login password-login csrf-token ; +SYMBOLS: botflag contact cookies csrf-token endpoint oauth-login +password-login ; + + t botflag set-global @@ -135,8 +141,7 @@ PRIVATE> { { "action" "query" } } params assoc-union api-call dup dup "query" of [ nip ] when* "siprop" params key? [ - params "prop" "list" "meta" [ of ] tri-curry@ tri or or - of + params { "prop" "list" "meta" } values-of sift first of ] unless swap ; PRIVATE>