-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.lisp
100 lines (77 loc) · 3.59 KB
/
test.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
;; -*- lisp -*-
(in-package :cl-mediawiki)
(log5:start-sender 'warnings-and-worse
(log5:stream-sender :location *error-output*)
:category-spec '(log5:warn)
:output-spec '(log5:time log5:message log5:context))
(debugging 'dribble+)
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:get-page-content "Pigment"))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:get-action-tokens "Pigment"))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:pages-that-embed "Template:Stub" ))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:get-page-info "Pigment" ))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:recent-changes))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:user-contribs "bobbysmith007"))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:userinfo))
(cl-mediawiki:with-mediawiki ("http://en.wikipedia.org/w")
(cl-mediawiki:list-category-members "Category:Formal_methods" :cmnamespace 14))
(wiki:with-mediawiki ("http://uk.wikipedia.org/w")
(wiki:siteinfo :siprop :namespaces))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:get-action-tokens "Test_Page"))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(let ((tokens (wiki:get-action-tokens "Test_Page")))
;(format t "tokens: ~A~%" tokens)
(wiki:set-page-content
tokens "Test_Page"
(format nil "This is a different {{coord dms|d|d|d|d|}} text with a link to the [[Main Page]] (~A)." (get-universal-time))
:bot T
:summary "action summary")))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(let ((tokens (wiki:get-action-tokens "Test_Page")))
;(format t "tokens: ~A~%" tokens)
(wiki:add-new-page-section
tokens "Test_Page" "New section"
(format nil "This is a different {{coord dms|d|d|d|d|}} text with a link to the [[Main Page]] (~A)." (get-universal-time))
:bot T)))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(let ((tokens (wiki:get-action-tokens "Test_Page")))
;(format t "tokens: ~A~%" tokens)
(wiki:append-text-to-page
tokens "Test_Page"
(format nil "~%~%This is a different {{coord dms|||||}} text with a link to the [[Main Page]] (~A).~%" (get-universal-time))
:bot T
:summary "action summary")))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(let ((tokens (wiki:get-action-tokens "Test_Page")))
;(format t "tokens: ~A~%" tokens)
(wiki:prepend-text-to-page
tokens "Test_Page"
(format nil "~%~%This is a different {{coord dms|||||}} text with a link to the [[Main Page]] (~A).~%~%" (get-universal-time))
:bot T
:summary "action summary")))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(let ((tokens (wiki:get-action-tokens "Test_Page")))
(format t "tokens: ~A~%" tokens)
(wiki:create-page
tokens "Some_New_Page"
(format nil "This is a different text with a link to the [[Main Page]] (~A)." (get-universal-time))
:summary "action summary")))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:login "user" "123"))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:userinfo))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:get-page-info "Title_Page" ))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:get-page-content "Title_Page" ))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:recent-changes))
(wiki:with-mediawiki ("http://localhost:8080/mediawiki")
(wiki:user-contribs "Dummy"))