Page MenuHomePhabricator

CIDR ranges api.php
Closed, ResolvedPublic

Description

Author: herd

Description:
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=1.2.3.0|1.2.3.1|1.2.3.2|1.2.3.3|1.2.3.4| ... |1.2.3.255

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):

&list=usercontribs&ucuser=1.2.3.0/24

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
URL: http://en.wikipedia.org/w/index.php?title=User:Splarka/contribsrange.js&oldid=194074278

Details

Reference
bz13157

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:01 PM
bzimport set Reference to bz13157.

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.

(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.