Last modified: 2014-02-12 23:38:19 UTC
I'm a Wikipedia addict, and I lose a lot of time on their Special:Random. It seems to me that a special page that populates itself with random links would be much more useful and efficient, so I'm requesting one. Please see http://en.wikipedia.org/wiki/User:Melchoir/ Random_links_proposal for more information and (hopefully) discussion.
Created attachment 1135 [details] Patch that describes the changes required to implement this feature request.
Created attachment 1136 [details] This file implements the special page.
Created attachment 1140 [details] Extension rather than inbuilt version of the other files. Per advice: http://mail.wikipedia.org/pipermail/wikitech-l/2005-December/032890.html changed this into extension format. All that's external to this file is the line in LocalSettings.php.
Not really sure what the benefit of this would be...? If you want to hit a bunch of random articles, just click several times on the random link and open them in a row of tabs...
Brion Vibber, my first motivation is speed. When I proposed this special page, Wikipedia was abominably slow, and Special:Random could take a minute just to begin displaying. Well, Special:Random is now down to a typical load time of a second, which isn't bad. Of course, I'm sure there will be slow periods in the future... Anyway, a list of random links would always be more efficient for finding particular kinds of links. Maybe you're interested in seeking out orphans, or uncategorized articles, or articles from a particular topic. Existing special pages and categories only go so far. There are some articles that can only be reached through random searches, and if you're looking for something with 1% abundance, you don't want to have to open 100 tabs! The proposed special page is a fast, compact, and well-organized way of getting to those hard-to-reach spots. By comparison, Special:Random is just entertainment.
There are some bugs. Those are 2 different variables: global $wgMessageCache; ... $wfMessageCache->addMessages( $messages ); The messages array construction is often written as x=array(key1 => value1, key2 => value2, ...) which seems easier to be read and understand than a block of assignments. For the part where you create the "out" string, you should better use MediaWiki functions to create the links instead of duplicating code there. For instance you might create a Title object for each article and ask that for its textual link representation (but there may be ever shorter ways, don't know). That way you don't need to consider things like "is main namespace or not". ... SpecialPage::addPage( new ExampleSpecialPage ); ... This is a non existing class. And another thought: In the end your class seems to be a database query listing its results. Eventually it might be a good idea to have your class be derived from PageQueryPage, so it would better integrate with the other database query special pages. But I can't say that for sure, it's only an idea.