Hello list,
I'm new to WikiMedia in general, and have been given the task to extend to API. We have created a SpecialPage that performs the actions desired, but we need to be able to access the output in XML, via the API. I have been looking for a good tutorial on creating API extensions and have come up empty handed.
Do you (any of you) know of a good resource for sample code or a tutorial? The general API documentation is good (though daunting) for making use of existing API calls, but what little information I did find (http://www.mediawiki.org/wiki/API:Calling_internally) is limited on creating a new API extension, especially when mimicking output of a 3rd party extension or custom written Special Page.
Any help will be appreciated. Thank you in advance!
--Sean Prunka
2009/4/27 Prunka, Sean PRUNKAS@battelle.org:
The general API documentation is good (though daunting) for making use of existing API calls, but what little information I did find (http://www.mediawiki.org/wiki/API:Calling_internally) is limited on creating a new API extension, especially when mimicking output of a 3rd party extension or custom written Special Page.
It's not limited to creating a new extension per se: adding a new class for an API module and registering it at the right places is something that can also be done "on the side" of a "regular" extension (in fact, it's almost always used this way, see AbuseFilter and FlaggedRevs for examples).
If you want to mimick the output of a special page, you'll have to get the data the same way the special page does; usually, that's through a database query. For examples of how to do database queries in API modules, see the ApiQuery*.php files in core (/trunk/phase3/includes/api in SVN).
Roan Kattouw (Catrope)
mediawiki-api@lists.wikimedia.org