Skip Menu |

This queue is for tickets about the MediaWiki-API CPAN distribution.

Report information
The Basics
Id: 44396
Status: resolved
Priority: 0/
Queue: MediaWiki-API

People
Owner: Nobody in particular
Requestors: bjoern [...] caret.cam.ac.uk
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.24
Fixed in: (no value)



Subject: Support for 'generator'?
Hi, this query api.php?action=query&generator=allpages&prop=revisions&rvprop=timestamp|user works (on MW 1.14.0), but my $articles = $mw->list ( { action => 'query', generator => 'allpages' , prop => 'revisions', rvprop => 'timestamp|user', gaplimit => 'max' }) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; throws this error Use of uninitialized value in hash element at .../5.8.8/MediaWiki/API.pm line 543. and returns $articles as empty. Should the allpages generator be supported? Thanks, Bjoern
On Wed Mar 18 06:48:20 2009, BjoernH wrote: Show quoted text
> Hi, > > this query > >
api.php?action=query&generator=allpages&prop=revisions&rvprop=timestamp|user Show quoted text
> > works (on MW 1.14.0), but > > my $articles = $mw->list ( { > action => 'query', > generator => 'allpages' , > prop => 'revisions', > rvprop => 'timestamp|user', > gaplimit => 'max' }) > || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; > > throws this error > > Use of uninitialized value in hash element at > .../5.8.8/MediaWiki/API.pm line 543. > > and returns $articles as empty. Should the allpages generator be > supported?
the 'list' call is set up specifically to make things a bit easier to do list queries that have the query-continue element and a similar output format. To replicate the api.php query above, use my $articles = $mw->api call instead.
Thanks for the response! Bjoern
Btw. this is a really great perl mod, keep up the good work. I am using this with mvs http://search.cpan.org/~markj/WWW-Mediawiki-Client/ e.g. to fetch recently changed wiki pages. Bjoern
On Wed Mar 18 07:20:53 2009, BjoernH wrote: Show quoted text
> Btw. this is a really great perl mod, keep up the good work. > > I am using this with mvs > http://search.cpan.org/~markj/WWW-Mediawiki-Client/ > e.g. to fetch recently changed wiki pages.
Thanks. Please feel free to add a review/rating to the module page on cpan :) I will investigate if I can make the list helper function or another new function to make it easier to use the list calls as generators (and automatically handle query-continue). but for now, you will have to process/handle that yourself. I will check your module out. Thanks again.
MVS isn't my module, but the concept of cvs-like access to a mediawiki installation is very good. Unfortunately it hasn't been updated in a while, and it also doesn't use the API. I've made some notes on MVS here, http://www.ict4e.net/wiki/Mvs All the best, Bjoern