On 16/10/2007, Platonides Platonides@gmail.com wrote:
Mike McGrath wrote:
I'd like to write a script that checks a few pages on my mediawiki install remotely. Probably using urlgrabber. Whats the most efficient way to determine if a page exists besides just grabbing the page?
-Mike
You could ask Special:Export for all pages at once which avoids querying each one. If you want to avoid querying page you already have, you can check its properties before on api.php
Of course, if you're querying multiple pages, then a far more efficient method is to do a batch check; this would be a very handy API module to have in core for multiple uses, not least of all interwiki existence checking[*], and would essentially be a simple wrapper around a LinkBatch operation.
* = though for Wikimedia sites, we'd probably want the option to query the database directly
Rob Church