cl-mediawiki
2016-12-07
A tool to help talk to mediawiki's api.
Upstream URL
License
Not determined
= CL-MediaWiki =
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!
== Project URL: ==
https://github.com/bobbysmith007/cl-mediawiki
== Supported API ==
* Edit
** create-page - Creates a new wiki page
** add-new-page-section - adds a new section to the specified wiki page
** append-text-to-page / prepend-text-to-page - adds text at the top or bottom of the specified page
** set-page-content - sets a pages content to the specified text
** 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
* Query
** token-bag - an object to store action tokens with a time stamp (to prevent overriding someone else's change
** get-action-tokens - requests and returns a token-bag for an edit/move/delete
** get-page-content - returns the content of the most recent revision of a page
** get-page-info - returns the properties of a page as an alist
** get-revisions - returns revision history of a page, including contents and diffs
** get-links - returns outgoing links from a page
** pages-that-embed - returns a list of pages that embed another page/template
** recent-changes - a list of recent changes to the wiki
** user-contribs - a list of contributions from a specific user
* Conditions
** Errors
*** media-wiki-error - signaled when media wiki returns an error
== Example ==
<pre>
;; Gets the content of page "Pigment" from wikipedia
(with-mediawiki ("http://en.wikipedia.org/w")
(get-page-content "Pigment"))
;; Gets the content of page "Pigment" from a private mediawiki that requires authentication
(with-mediawiki ((make-instance 'mediawiki
:url "http://wiki.yourdomain.net"
:auth (list "user" "pass")))
(get-page-content "Pigment"))
;; Sets the content of page "Pigment" to be "This is the new content"
(with-mediawiki (...)
(set-page-content "Pigment" "This is the new content"))
;; Get the ids, user, and size of the last 10 revisions
(with-mediawiki ("http://en.wikipedia.org/w")
(get-revisions "Pigment" :rvprop "ids|user|size" :rvlimit 10))
</pre>
== Dependencies ==
* [http://common-lisp.net/project/cxml/ Closure-XML]
* [http://weitz.de/drakma/ Drakma]
=== Optional Dependencies ===
* [http://weitz.de/cl-ppcre/ CL-PPCRE] - If you have this installed, there will be a couple more functions available
== News ==
* [http://russ.unwashedmeme.com/blog/?p=135 Hosting Move Announcement]
* [http://russ.unwashedmeme.com/blog/?p=52 Blagging about my first in system usage of CL-MediaWiki]
* [http://russ.unwashedmeme.com/blog/?p=43 Introductory Blog Post]
== Authors ==
* [http://www.acceleration.net/ Acceleration.net] [http://www.acceleration.net/programming/donate-to-acceleration-net/ Donate]
** [http://russ.unwashedmeme.com/blog Russ Tyndall]
** [http://the.unwashedmeme.com/blog Nathan Bird]
** [http://ryepup.unwashedmeme.com/blog Ryan Davis]
* [https://github.com/algal Alexis Gallagher]
<pre>
;; Copyright (c) 2011 Russ Tyndall , Acceleration.net http://www.acceleration.net
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are
;; met:
;;
;; - Redistributions of source code must retain the above copyright
;; notice, this list of conditions and the following disclaimer.
;;
;; - Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</pre>k