Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 66790
Status: resolved
Priority: 0/
Queue: MediaWiki-Bot

People
Owner: Nobody in particular
Requestors: eleonora45 [...] gmx.net
Cc:
AdminCc:

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



Subject: get_pages_in_namespace gets maximum 500 names in present wikipedia
Date: Tue, 22 Mar 2011 22:25:27 +0100
To: bug-MediaWiki-Bot [...] rt.cpan.org
From: eleonora45 <eleonora45 [...] gmx.net>
Hi, get_pages_in_namespace gets maximum 500 names in present wikipedia, highlimits does not work -------------------------------------------------------------------- #!/usr/bin/perl use MediaWiki::Bot; use strict; my $mw = MediaWiki::Bot->new(); $mw->set_wiki("hu.wikipedia.org", "w"); $mw->set_highlimits(100000); my @pages; @pages = $mw->get_pages_in_namespace(6, 100000); my $pn = @pages; for(my $i = 0; $i < $pn; $i++){ print "$i page:'$pages[$i]'\n"; } ----------------------------------------------------------------------------------- If I set highlimit to 600, I also get only 500 file names. MediaWiki::Bot Module Version: 3.2.7, freshly installed on linux debian, mint 9.0. What do you think? Thanks, eleonora
On Tue Mar 22 17:25:44 2011, eleonora45@gmx.net wrote: Show quoted text
> If I set highlimit to 600, I also get only 500 file names.
That's not what highlimit does - it simply sets whether to use higher limits on how many results you can get in a single request. For example, an account with the bot flag might be permitted to get 5000 items in a single request. To set how many requests to make (ie how many batches of 5000) to get, set the 'max' key in the options hashref for methods which use that. Currently, get_pages_in_namespace does, but it isn't documented. And the implementation is slightly broken. I will fix both those issues shortly.
On Tue Mar 22 18:17:45 2011, DOHERTY wrote: Show quoted text
> Currently, get_pages_in_namespace does, but it isn't documented. > And the implementation is slightly broken. I will fix both those > issues shortly.
Fixed in r478.
Subject: Re: [rt.cpan.org #66790] get_pages_in_namespace gets maximum 500 names in present wikipedia
Date: Wed, 23 Mar 2011 08:50:43 +0100
To: bug-MediaWiki-Bot [...] rt.cpan.org
From: eleonora45 [...] gmx.net
Hi, on cpan is still 3.2.7. When do you put the current version there? Please provide an example, how to get all pages of a namespace. Your explanations are not undestandable: -------------- To set how many requests to make (ie how many batches of 5000) to get, set the 'max' key in the options hashref for methods which use that. Currently, get_pages_in_namespace does, but it isn't documented. And the implementation is slightly broken. I will fix both those issues shortly. --------- Thank you. 2011-03-22 23:48 keltezéssel, Mike Doherty via RT írta: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=66790 > > > On Tue Mar 22 18:17:45 2011, DOHERTY wrote:
>> Currently, get_pages_in_namespace does, but it isn't documented. >> And the implementation is slightly broken. I will fix both those >> issues shortly.
> > Fixed in r478. >
-- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
On Wed Mar 23 03:50:54 2011, eleonora45@gmx.net wrote: Show quoted text
> Hi, > > on cpan is still 3.2.7. When do you put the current version there? > Please provide an example, how to get all pages of a namespace. Your > explanations are not undestandable
I want to clean up the documentation a little bit more before I release a new version. The next release will include the following documentation for this method: get_pages_in_namespace $bot->get_pages_in_namespace($namespace, $limit, $options_hashref); Returns an array containing the names of all pages in the specified namespace. The $namespace_id must be a number, not a namespace name. Setting $limit is optional, and specifies how many items to retrieve at once. Setting this to 'max' is recommended, and this is the default if omitted. If $page_limit is over 500, it will be rounded up to the next multiple of 500. If $page_limit is set higher than you are allowed to use, it will silently be reduced. Consider setting key 'max' in the options hashref to retrieve multiple sets of results: # Gotta get 'em all! my @pages = $bot->get_pages_in_namespace(6, 'max', { max => 0 }); This can still be improved, and I encourage you to suggest such improvements.
Subject: Re: [rt.cpan.org #66790] get_pages_in_namespace gets maximum 500 names in present wikipedia
Date: Wed, 23 Mar 2011 17:22:32 +0100
To: bug-MediaWiki-Bot [...] rt.cpan.org
From: eleonora45 <eleonora45 [...] gmx.net>
I tried it, and it works well. Also the usage is easy. Thank you for quick fix. -eleonora 2011-03-23 14:07 keltezéssel, Mike Doherty via RT írta: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=66790> > > On Wed Mar 23 03:50:54 2011, eleonora45@gmx.net wrote: >
>> Hi, >> >> on cpan is still 3.2.7. When do you put the current version there? >> Please provide an example, how to get all pages of a namespace. Your >> explanations are not undestandable >>
> I want to clean up the documentation a little bit more before I release a new version. The next release will > include the following documentation for this method: > > > get_pages_in_namespace > $bot->get_pages_in_namespace($namespace, $limit, $options_hashref); > > Returns an array containing the names of all pages in the specified > namespace. The $namespace_id must be a number, not a namespace name. > > Setting $limit is optional, and specifies how many items to > retrieve at once. Setting this to 'max' is recommended, and this is the > default if omitted. If $page_limit is over 500, it will be rounded up > to the next multiple of 500. If $page_limit is set higher than you are > allowed to use, it will silently be reduced. Consider setting key 'max' > in the options hashref to retrieve multiple sets of results: > > # Gotta get 'em all! > my @pages = $bot->get_pages_in_namespace(6, 'max', { max => 0 }); > > This can still be improved, and I encourage you to suggest such improvements. > >