Extension:ScribuntoMediawikiApi
Appearance
Release status: beta |
|
|---|---|
| Description | Provide action API for Lua modules |
| Author(s) | Urfiner (Nikolai Kochkin) |
| Latest version | 0.1.0 |
| MediaWiki | 1.39+ |
| License | MIT License |
| Download | GitHub:
Note: |
The ScribuntoMediawikiApi extension provides Lua modules with the ability to interact with the MediaWiki Action API. This allows Lua scripts to query and manipulate MediaWiki data programmatically.
Please use GitHub issues for leaving feedback, reporting issues and requesting features. I may miss your message on the Discussions tab.
Installation
[edit]- Download and place the file(s) in a directory called
ScribuntoMediawikiApiin yourextensions/folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'ScribuntoMediawikiApi' );
Done â Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage example
[edit]- Create a new Lua module on your MediaWiki with a content like:
local p = {} function p.test() return mw.api.actionApiCall{ action = 'query', meta = 'userinfo' } end return p
- Try to call the main method in debug console:
mw.logObject(p.test())
table#1 { ["batchcomplete"] = true, ["query"] = table#2 { ["userinfo"] = table#3 { ["id"] = 1, ["name"] = "Niko", }, }, }
