Last modified: 2007-06-17 08:51:13 UTC
Please add new feature to allow to choose namespace(s) of links on such page. Eg. get all links to Help ns only on Wikipedia:Foo page. Thanks
Some examples of possible code: api.php? ... &plnamespaces=10 -- show only links to the pages in namespace 10 api.php? ... &plnamespaces=1|3|5|7|9|11 show only links to all talks etc...
I'll work on it some time this weekend, patch should be ready by Monday (possibly earlier if I have time).
Created attachment 3791 [details] Implements filtering by namespace for prop=links and prop=templatelinks Miraculously, I've actually found time to do this today. The attached patch (tested and found to work) implements a plnamespace parameter just like you asked for. Because prop=links and prop=templatelinks share code, prop=templatelinks now also has a tlnamespace parameter which does exactly the same thing. Help text from the patched version: * prop=links (pl) * Returns all links from the given page(s) Parameters: plnamespace - Show links in this namespace(s) only Values (separate with '|'): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 Examples: Get links from the [[Main Page]]: api.php?action=query&prop=links&titles=Main%20Page Get information about the link pages in the [[Main Page]]: api.php?action=query&generator=links&titles=Main%20Page&prop=info Get links from the Main Page in the User and Template namespaces: api.php?action=query&prop=links&titles=Main%20Page&plnamespace=2|10 Generator: This module may be used as a generator * prop=templates (tl) * Returns all templates from the given page(s) Parameters: tlnamespace - Show templates in this namespace(s) only Values (separate with '|'): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 Examples: Get templates from the [[Main Page]]: api.php?action=query&prop=templates&titles=Main%20Page Get information about the template pages in the [[Main Page]]: api.php?action=query&generator=templates&titles=Main%20Page&prop=info Get templates from the Main Page in the User and Template namespaces: api.php?action=query&prop=templates&titles=Main%20Page&tlnamespace=2|10 Generator: This module may be used as a generator It may take some time for this patch to be accepted into the code, but if you really want to try it you can of course set up your own test wiki and apply this patch to it. Hope this helps, Roan Kattouw
Fixed in 23044