From eb19fc04b2b2c5aace755342122a93fac3b7e6ec Mon Sep 17 00:00:00 2001 From: Giftpflanze Date: Sun, 27 Mar 2022 21:59:10 +0200 Subject: [PATCH] mediawiki.api: Fix documentation, improvements --- extra/mediawiki/api/api-docs.factor | 2 +- extra/mediawiki/api/api.factor | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) 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> -- 2.34.1