API talk:Query - Randompage
[edit] Generator suggestion
Like I said on the mailing list, I think it'd be better to have this module just return
<api> <query> <randompage> <page pageid="2" ns="0" title="Zaragoza" /> </randompage> </query> </api>
and allow the user to obtain revision content and other information through the generator system:
api.php?action=query&generator=randompage&prop=info api.php?action=query&generator=randompage&prop=revisions&rvprop=user|comment|content api.php?action=query&generator=randompage&prop=links etc.
--Catrope 10:57, 18 October 2007 (UTC)
OK, I take note of the format you propose. What I don't see is why use the generator. It could be done like that, but we want to give the chance to get all the information in just one step. If it is possible to have all of this in one single request, why using two? At the end prop parameters may be optional. --Raquel.Frisa 14:17, 18 October 2007 (UTC)
- True, but we want to prevent code duplication, plus generators are more flexible (prop=links|templates|extlinks also possible). And using generators is still just one request. --Catrope 14:11, 22 October 2007 (UTC)
OK, Now we have the functionality with prop=random. Just let us to see how easy is to do the same with generator=random. --Raquel.Frisa 13:31, 25 October 2007 (UTC)
[edit] rpns parameter
Like you suggested on the mailing list earlier, a parameter for namespace filtering may be useful (don't know whether it's easy to implement, though). --Catrope 10:57, 18 October 2007 (UTC)
Yeah... We had it in mind for next step. --Raquel.Frisa 14:18, 18 October 2007 (UTC)
DONE! --Raquel.Frisa 13:30, 25 October 2007 (UTC)
[edit] titletext return value
What's the difference between title and titletext? --Catrope 15:52, 24 October 2007 (UTC)
Like appear in code's documentation, the titletext is returned by getFullText method and says: "get the prefixed title with spaces, plus any fragment (part beginning with '#')", while the title is returned by getIndexTitle method and says: "Get title for search index". Finally we only return title parameter but now it's returned by getPrefixedText ("Get the prefixed title with spaces").--Abernala 09:33, 12 November 2007 (UTC)