Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: jidanni [...] jidanni.org
Cc:
AdminCc:

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



Subject: allow forcing GET instead of POST
Date: Tue, 12 May 2009 08:09:56 +0800
To: bug-mediawiki-api [...] rt.cpan.org
From: jidanni [...] jidanni.org
I use WWWOFFLE. The inability to force the following to use GET means that I have to go on the network each time I test this, no matter what: use MediaWiki::API; my $mw = MediaWiki::API->new(); $mw->{ua}->env_proxy; for (@ARGV) { $mw->{config}->{api_url} = "http://$_/api.php"; my $articles = $mw->list( { action => 'query', list => 'exturlusage', eulimit => 'max', euprop => 'title|url' } ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; }
On Mon May 11 20:11:07 2009, jidanni@jidanni.org wrote: Show quoted text
> I use WWWOFFLE. The inability to force the following to use GET means > that I have to go on the network each time I test this, no matter what:
Please test this new version and let me know if it works for you. http://malus.exotica.org.uk/~buzz/cpan/MediaWiki-API-0.26.tar.gz
Subject: Re: [rt.cpan.org #45974] allow forcing GET instead of POST
Date: Thu, 14 May 2009 04:22:39 +0800
To: bug-mediawiki-api [...] rt.cpan.org
From: jidanni [...] jidanni.org
[Summary, I'm too debian oriented, will wait for debian.] OK, here offline I tried to install MediaWiki-API-0.26/ # Error: Can't locate JSON.pm in @INC (@INC contains: But 0.26 2009-05-12 Switched the module to ask for the JSON module and not specifically JSON::XS. If JSON::XS is available the JSON module will use it by default, but if not it will fallback to a pure perl JSON parser. But the install process didn't fallback... so later today I'll have to pick from one of these packages: $ apt-file search JSON.pm libcatalyst-modules-perl: /usr/share/perl5/Catalyst/Helper/View/JSON.pm libcatalyst-modules-perl: /usr/share/perl5/Catalyst/View/JSON.pm libcgi-application-extra-plugin-bundle-perl: /usr/share/perl5/CGI/Application/Plugin/JSON.pm libconfig-any-perl: /usr/share/perl5/Config/Any/JSON.pm libconfig-json-perl: /usr/share/perl5/Config/JSON.pm libdata-serializer-perl: /usr/share/perl5/Data/Serializer/JSON.pm libjifty-perl: /usr/share/perl5/Jifty/JSON.pm libjson-perl: /usr/share/perl5/JSON.pm libwiki-toolkit-plugin-json-perl: /usr/share/perl5/Wiki/Toolkit/Plugin/JSON.pm openguides: /usr/share/perl5/OpenGuides/JSON.pm I.e., bewildering choices. TellyawhatI'mgonnado. As I hate to have things in /usr/local, I'll just # cd MediaWiki-API-0.25 # make -n uninstall /usr/bin/perl "-MExtUtils::Command::MM" -e uninstall /usr/local/lib/perl/5.10.0/auto/MediaWiki/API/.packlist /bin/sh -c true # make uninstall Uninstall is unsafe and deprecated, the uninstallation was not performed. We will show what would have been done. unlink /usr/local/man/man3/MediaWiki::API.3pm unlink /usr/local/share/perl/5.10.0/MediaWiki/API.pm unlink /usr/local/lib/perl/5.10.0/auto/MediaWiki/API/.packlist Uninstall is unsafe and deprecated, the uninstallation was not performed. Please check the list above carefully, there may be errors. Remove the appropriate files manually. Sorry for the inconvenience. WHY DOESN'T it say so upon make -n uninstall? One more reason I'll wait just wait for a .deb. And the README only mentions INSTALLATION no UNinstallation. AND why is there no supposed correct uninstall method offered, by this CPAN business, or why doesn't it give you guys one? What if apt had no official remove or purge methods? Should I file a CPAN bug? Where? OK, removed them. Had to remove the directories by hand though. purged libjson-xs-perl Anyway, I'll turn my efforts to campaigning for a .deb. To bad RT doesn't reveal your private email address like the Debian BTS, as part of the above needn't bore others.
On Wed May 13 16:23:00 2009, jidanni@jidanni.org wrote: Show quoted text
> But the install process didn't fallback... so later today I'll have to > pick from one of these packages:
Show quoted text
> libjson-perl: /usr/share/perl5/JSON.pm
this is the one you need. (and keep the XS one installed and it should use it.) If you want a debian package. unpack the tar.gz and cd to the folder and do dh-make-perl dpkg-buildpackage and you should end up with a deb in the parent folder. The dh-make-perl will also output something like Needs the following debian packages: libwww-perl, libjson-perl I will update the install instructions. actually they were generated by the perl module template thingy i used. if for any reason you are unable to build a package still you can try http://malus.exotica.org.uk/~buzz/cpan/libmediawiki-api-perl_0.26-1_all.deb Cheers. Please let me know how you get on.
Subject: Re: [rt.cpan.org #45974] allow forcing GET instead of POST
Date: Thu, 14 May 2009 07:22:39 +0800
To: bug-mediawiki-api [...] rt.cpan.org
From: jidanni [...] jidanni.org
OK Show quoted text
installs nicely. Hope it gets into Debian soon. You'll of course hear lots from me when I next use it, every few days.
Subject: Re: [rt.cpan.org #45974] allow forcing GET instead of POST
Date: Thu, 14 May 2009 10:40:26 +0800
To: bug-mediawiki-api [...] rt.cpan.org
From: jidanni [...] jidanni.org
Say, why not make 1 the default? When would it ever hurt? o use_http_get = Boolean 0 or 1 (defaults to 0). If set to 1, the perl module will use http GET method for accessing the api. By default it uses the POST method. Note that the module will still use POST for the api calls that require POST no matter what the value of this configuration option.
On Wed May 13 22:40:50 2009, jidanni@jidanni.org wrote: Show quoted text
> Say, why not make 1 the default? > When would it ever hurt? > o use_http_get = Boolean 0 or 1 (defaults to 0). If set to 1, > the perl module will use http GET method for > accessing the api. By default it uses the POST method. Note > that the module will still use POST for the api > calls that require POST no matter what the value of this > configuration option.
Some calls work with GET. some require POST, but all work with POST. It makes sense to use POST to guarantee any new calls will work. Even if i keep it at just action=query that works with GET, I don't see the advantage in using GET as a default.
Subject: Re: [rt.cpan.org #45974] allow forcing GET instead of POST
Date: Thu, 14 May 2009 14:18:05 +0800
To: bug-mediawiki-api [...] rt.cpan.org
From: jidanni [...] jidanni.org
Well OK, but be sure to mark on the man page next to which functions can also use GET, otherwise the user must dig through the code if say he doesn't want to trigger any POSTs today.
On Thu May 14 02:18:31 2009, jidanni@jidanni.org wrote: Show quoted text
> Well OK, but be sure to mark on the man page next to which functions can > also use GET, otherwise the user must dig through the code if say he > doesn't want to trigger any POSTs today.
This information is available from the official Mediawiki API documentation. Basically it says which need to use POST, and when it doesn't you can use GET. Because of the constantly changing nature, I prefer not to maintain such a list myself. As a quick guide, the action=query calls all can use GET. the editing stuff is POST. 0.27 is in the upload queue now. I shall close this bug. Thanks for your report.