Roan Kattouw wrote:
2010/4/11 Roan Kattouw roan.kattouw@gmail.com:
2010/4/11 Claes Lindvall classe@ekvagen.com:
Hi
Im having trouble to get MediaWiki::API ver. 0.30 to work properly. Im running MediaWiki 1.13 and my simple query is:
use MediaWiki::API;
my $mw = MediaWiki::API->new(); $mw->{config}->{api_url} = 'http://192.168.10.1/wiki15/api.php';
$mw->list ( { action => 'query', list => 'Page1', export => '1', exportnowrap => '1' })
You need to pass format => 'json'
Or wait, MediaWiki::API takes care of that. Rather, the problem is with exportnowrap => 1. By passing that parameter you're explicitly asking for the XML not to be wrapped in JSON, on which the JSON parser chokes. Omit this parameter and you should be fine.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Thank you so much. It helped.
Regards Claes Lindvall