[19:46:40] How do we combine API queries? I'm trying to get a random file from a specific category on Commons. Poking at the sandbox and looking at the docs, I've found these likely possibilities, but I cannot determine how to merge any of them together: https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=categorymembers%7Crandom&generator=random&cmtitle=Category%3AFelis%20silvestris%20catus&cmtype=file&cmlimit=1&rnnam [19:46:40] espace=6&rnfilterredir=nonredirects&grnnamespace=6&grnfilterredir=nonredirects&grnlimit=1 (currently outputting a single unchanging page from the category, and 2 random files from anywhere) [19:46:47] gah, URLS. https://commons.wikimedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=categorymembers%7Crandom&generator=random&cmtitle=Category%3AFelis%20silvestris%20catus&cmtype=file&cmlimit=1&rnnamespace=6&rnfilterredir=nonredirects&grnnamespace=6&grnfilterredir=nonredirects&grnlimit=1 [19:47:22] The generator parameter [19:47:48] Oh, i think you already got that [19:48:34] yup, found that, but cannot tell how to combine it with list=categorymembers [19:48:49] hmm, this depends a lot on if the randomincategory thing ever actually got turned into an api [19:49:17] Honestly, the api is not very good for this usecase. You can combine queries so that one query finds things, and the other gets information [19:49:24] ah, ok. I wasn't sure whether we could pipe one into another, and thus create magic. [19:49:33] ty bawolff :) [19:49:35] but you can't really combine them in the sense of filtering [19:50:10] There are certain cases where you can sort of pipe like that, but its really rather limited [19:53:10] quiddity: So your best options this case, are either https://commons.wikimedia.org/wiki/Special:RandomInCategory/Felis_silvestris_catus which really doesn't do what you want (since it includes non-images) and has a terrible random number generator [19:53:24] Or quarry.wmflabs.org [19:53:51] ty again. (Someone asked for this info in #wikimedia, and I thought I'd investigate for them. I'll pass along the answer via a log link.) [19:54:42] I'll come up with an sql query for them in a minute [19:57:46] https://quarry.wmflabs.org/query/23738 [19:58:53] Actually, I wonder if WDQS would be useful in this situation, I think they were talking about adding category tree info to it [19:59:58] Probably not [20:50:46] SMalyshev: About https://gerrit.wikimedia.org/r/#/c/392175 . I however don't feel super strongly about it, so if you'd prefer, I'm willing to +2 as you have the patch now