readme formatting
[cl-mediawiki.git] / README.mediawiki
blobb2b5723658766e223ae8960848f072a05151b7f2
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 == Supported API ==
7 * Edit
8 ** create-page - Creates a new wiki page
9 ** add-new-page-section - adds a new section to the specified wiki page
10 ** append-text-to-page / prepend-text-to-page - adds text at the top or bottom of the specified page
11 ** set-page-content - sets a pages content to the specified text
12 ** 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
13 * Query 
14 ** token-bag - an object to store action tokens with a time stamp (to prevent overriding someone else's change
15 ** get-action-tokens - requests and returns a token-bag for an edit/move/delete
16 ** get-page-content - returns the content of the most recent revision of a page
17 ** get-page-info - returns the properties of a page as an alist
18 ** pages-that-embed - returns a list of pages that embed another page/template
19 ** recent-changes - a list of recent changes to the wiki
20 ** user-contribs - a list of contributions from a specific user
21 * Conditions 
22 ** Errors
23 *** media-wiki-error - signaled when media wiki returns an error
25 == Example ==
27 <pre>
28  ;; Gets the content of page "Pigment" from wikipedia
29  (with-mediawiki ("http://en.wikipedia.org/w")
30     (get-page-content "Pigment"))
32  ;; Gets the content of page "Pigment" from a private mediawiki that requires authentication
33  (with-mediawiki ((make-instance 'mediawiki
34                                  :url "http://wiki.yourdomain.net"
35                                  :auth (list "user" "pass")))
36     (get-page-content "Pigment"))
38  ;; Sets the content of page "Pigment" to be "This is the new content"
39  (with-mediawiki (...)
40     (set-page-content "Pigment" "This is the new content"))
41 </pre>
43 == Dependencies ==
44 * [http://common-lisp.net/project/cxml/ Closure-XML]
45 * [http://weitz.de/drakma/ Drakma]
47 === Optional Dependencies ===
48 * [http://weitz.de/cl-ppcre/ CL-PPCRE] - If you have this installed, there will be a couple more functions available
50 == News ==
51 * [http://russ.unwashedmeme.com/blog/?p=135 Hosting Move Announcement]
52 * [http://russ.unwashedmeme.com/blog/?p=52 Blagging about my first in system usage of CL-MediaWiki]
53 * [http://russ.unwashedmeme.com/blog/?p=43 Introductory Blog Post]