<commit_before>= 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
** 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"<commit_msg>updated summary of get-revisions<commit_after>= 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"
{'fraction_non_alphanumeric': 0.09387853859182192, 'fraction_numerical': 0.0014517299782240503, 'mean_word_length': 3.8350877192982455, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1496958', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1122, 'n_words': 526}