CIDR ranges api.php
Closed, ResolvedPublic


Author: herd

After r30578 it is now possible to list multiple parameters to &list=usercontribs&ucuser= ... this also creates the possibility for very efficient pseudo-CIDR lookups, eg:

&list=usercontribs&ucuser=||||| ... |

A typically tested /24 takes only .4 seconds on en.wp, and goes back to at least 2002. However the URI limit at Wikimedia seems to be about 4000 characters, slightly liming the usefulness of this (and using format=json in a <script> precludes using POST).

Could this behavior, then, be supported natively? Either via CIDR formatting? say up to /24 for normal users, and maybe as far as /20 or even /16 for bots (which could take over a minute):


Or perhaps some sort of prefix parameters: &ucuserprefix=1.2.3. (though this may not be optimal)

Whichever is most efficient to the current design of parallel user lookup, while allowing a shorter URL.

Version: unspecified
Severity: enhancement

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 10:01 PM
bzimport set Reference to bz13157.
bzimport created this task.Via LegacyFeb 26 2008, 4:08 AM
Catrope added a comment.Via ConduitFeb 26 2008, 10:10 AM

I'll look into this.

Catrope added a comment.Via ConduitFeb 26 2008, 4:58 PM

I implemented your latter suggestion (ucuserprefix) in r31312. Keep in mind that ucuserprefix doesn't take multiple values (for efficiency reasons), also works for regular user names and overrides ucuser if present.

Catrope added a comment.Via ConduitMar 3 2008, 10:09 AM

(In reply to comment #3)

Seems to work great for CIDR! One problem I've run in to though using
ucuserprefix for regular user names... how do you encode spaces?

That was a bug, fixed in r31489. Tim%20Star works now.

Add Comment