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
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
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
Rob Church wrote:
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
In my case the pages are more codes, there will be thousands of codes, only a few being checked at a time so an api would be handy.
-Mike
Mike McGrath wrote:
Rob Church wrote:
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
In my case the pages are more codes, there will be thousands of codes, only a few being checked at a time so an api would be handy.
-Mike
I think you missed that Rob and I were talking about an *existing* api with which you can do batch queries. http://www.mediawiki.org/wiki/API
mediawiki-l@lists.wikimedia.org