exported new query get-links
[cl-mediawiki.git] / README.mediawiki
blob80a55cf41cb7564f2a438c50a330643bd07d2636
1 = CL-MediaWiki =
3 This is a project to help make the [http://www.mediawiki.org/wiki/API MediaWiki API] accessible and easy to use from Common Lisp.  While this project is currently sparsely populated, what commands are there should work.  Patches Welcome!
5 == Project URL: ==
7 https://github.com/bobbysmith007/cl-mediawiki
9 == Supported API ==
11 * Edit
12 ** create-page - Creates a new wiki page
13 ** add-new-page-section - adds a new section to the specified wiki page
14 ** append-text-to-page / prepend-text-to-page - adds text at the top or bottom of the specified page
15 ** set-page-content - sets a pages content to the specified text
16 ** regex-replace-all - replace all instances of regex with replacement on a target-page.  There is an option for passing what the page content should be if it does not exist
17 * Query 
18 ** token-bag - an object to store action tokens with a time stamp (to prevent overriding someone else's change
19 ** get-action-tokens - requests and returns a token-bag for an edit/move/delete
20 ** get-page-content - returns the content of the most recent revision of a page
21 ** get-page-info - returns the properties of a page as an alist
22 ** pages-that-embed - returns a list of pages that embed another page/template
23 ** recent-changes - a list of recent changes to the wiki
24 ** user-contribs - a list of contributions from a specific user
25 * Conditions 
26 ** Errors
27 *** media-wiki-error - signaled when media wiki returns an error
29 == Example ==
31 <pre>
32  ;; Gets the content of page "Pigment" from wikipedia
33  (with-mediawiki ("http://en.wikipedia.org/w")
34     (get-page-content "Pigment"))
36  ;; Gets the content of page "Pigment" from a private mediawiki that requires authentication
37  (with-mediawiki ((make-instance 'mediawiki
38                                  :url "http://wiki.yourdomain.net"
39                                  :auth (list "user" "pass")))
40     (get-page-content "Pigment"))
42  ;; Sets the content of page "Pigment" to be "This is the new content"
43  (with-mediawiki (...)
44     (set-page-content "Pigment" "This is the new content"))
45 </pre>
47 == Dependencies ==
49 * [http://common-lisp.net/project/cxml/ Closure-XML]
50 * [http://weitz.de/drakma/ Drakma]
52 === Optional Dependencies ===
54 * [http://weitz.de/cl-ppcre/ CL-PPCRE] - If you have this installed, there will be a couple more functions available
56 == News ==
58 * [http://russ.unwashedmeme.com/blog/?p=135 Hosting Move Announcement]
59 * [http://russ.unwashedmeme.com/blog/?p=52 Blagging about my first in system usage of CL-MediaWiki]
60 * [http://russ.unwashedmeme.com/blog/?p=43 Introductory Blog Post]