(use posix mw-core testeez sxpath) (default-wiki "http://en.wikipedia.org/w/api.php") (testeez "mw-core" (test/equal "Raw XML response from Wikipedia" (let* ((response (raw-api-call '((action . query)(meta . siteinfo)(format . xml)))) (len (string-length response))) (string-append (substring response 0 33) (substring response (- len 14)))) "") (test/equal "Raw json response from Wikipedia" (let* ((response (raw-api-call '((action . query)(meta . siteinfo)(format . json)))) (len (string-length response))) (substring response 0 32)) "{\"query\":{\"general\":{\"mainpage\":") (test/equal "pipejoin" (pipejoin '(a "b" "c d" 12)) "a|b|c d|12") (test/equal "sx-call sanity check" (let* ((response (sx-call '((action . query)(meta . siteinfo))))) (map (sxpath "api/query/general/@wikiid") response)) '(((wikiid "enwiki")))) (test/equal "usercontribs continue test" (let* ((response (sx-call '((action . query)(list . usercontribs)(ucuser . "Jimbo Wales") (uclimit . 1)(ucstart . "2009-11-10T00:00:00Z")(ucend . "2009-11-01T00:00:00Z"))))) (length ((sxpath "api/query/usercontribs/item") response))) 8) )