Code Monkey home page Code Monkey logo

cl-mediawiki's Introduction

Table of Contents

CL-MediaWiki

This is a project to help make the 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

 ;; 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))

Dependencies

Optional Dependencies

  • CL-PPCRE - If you have this installed, there will be a couple more functions available

News

Authors

;; 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.
k

cl-mediawiki's People

Contributors

algal avatar bobbysmith007 avatar epostavs avatar fiddlerwoaroof avatar puercopop avatar ryepup avatar whalliburton avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.