[Cloud] Re: Validating multiple usernames?

2021-08-19 Thread Bryan Davis
On Thu, Aug 19, 2021 at 4:04 PM Roy Smith wrote: > > I've got a tool which parses sockpuppet investigation (SPI) pages and does > some analysis. One of the steps is I need to validate that all of the > usernames found in the SPI report are valid. I do that by sequentially > calling usercontri

[Cloud] Re: Validating multiple usernames?

2021-08-19 Thread Roy Smith
Ah, cool. That's exactly what I was looking for, thanks. > On Aug 19, 2021, at 6:21 PM, Bryan Davis wrote: > > On Thu, Aug 19, 2021 at 4:04 PM Roy Smith wrote: >> >> I've got a tool which parses sockpuppet investigation (SPI) pages and does >> some analysis. One of the steps is I need to va

[Cloud] Re: Validating multiple usernames?

2021-09-04 Thread Roy Smith
I turns out, this is a little more complicated than it appeared at first; usercontribs and list users have different concepts of "invalid". If you ask for usercontribs on "1.2.3.4", it's valid. If you pass in "1.2.3.0/24", you get baduser.. But list users returns: { "batchcomplete": "",

[Cloud] Re: Validating multiple usernames?

2021-09-05 Thread Roy Smith
Sigh. It's even more complicated than that. It looks like the "name" entry doesn't always match the name you passed in the API call, but is subject to case mapping, trailing whitespace stripping, and maybe a few other things? $ curl -s 'https://en.wikipedia.org/w/api.php?action=query&format=j

[Cloud] Re: Validating multiple usernames?

2021-09-05 Thread Roy Smith
Ugh. That's not even true. It looks like all the invalid entries are emitted first, then the valid ones. And duplicates are deduplicated. So, we're down to you give it a bunch of names, and it gives you back a a bunch of data which may not have the same number of entries as your input list, t

[Cloud] Re: Validating multiple usernames?

2021-09-05 Thread Bryan Davis
On Sun, Sep 5, 2021 at 1:18 PM Roy Smith wrote: > > Sigh. It's even more complicated than that. It looks like the "name" entry > doesn't always match the name you passed in the API call, but is subject to > case mapping, trailing whitespace stripping, and maybe a few other things? MediaWiki n

[Cloud] Re: Validating multiple usernames?

2021-09-09 Thread Roy Smith
That can't be right. I think you meant, "Reduce any runs of multiple underscores to a single SPACE" and then "Trim any leading or trailing spaces" > On Sep 6, 2021, at 12:15 AM, Bryan Davis wrote: > > * Replace all whitespace characters with underscores (`_`) > * Reduce any runs of multiple un

[Cloud] Re: Validating multiple usernames?

2021-09-09 Thread AntiCompositeNumber
Yes, the canonical form of usernames is with spaces, but the canonical form of page titles is with underscores. No this hasn't ever confused anyone or caused me any problems, why do you ask? ACN On Thu, Sep 9, 2021 at 10:56 AM Roy Smith wrote: > > That can't be right. I think you meant, "Reduc

[Cloud] Re: Validating multiple usernames?

2021-09-09 Thread Roy Smith
See the first message in this thread . > On Sep 9, 2021, at 10:57 AM, AntiCompositeNumber > wrote: > > Yes, the canonical form of usernames is with spaces, but the canonical > form