The RandomPagesPlugin (aka RandomPages) is a NeWikiPlugin that provides a randomly-updated, randomly-sized list of randomly-selected wiki pages. This notably does not update the list each time it is called but maintains a WikiEngine-specific Timer thread that manages the list. The idea being that for a random amount of time everyone on the wiki sees the same set of pages.
There's a certain perversity in the way this plugin works. Rather than provide a different set each time it is queried it updates itself randomly. If there are multiple instances of the plugin on the wiki, the single instance of the page generator (called the RandomPagesScheduler) takes the maximum values specified by all instances. The only way to reset the scheduler to a smaller value than the current maximum is to restart the wiki engine. Whether this is the best policy in the long run remains to be seen. Currently the maximum values (which over time the plugin may end up at) may need to be set a bit lower.
Parameters#
- maxpages = 'n'
- Returns a list of between 5 and n pages. If unspecified or less than 5, a maximum count of 10 is used (i.e., between 5 and 10 pages).
- refresh = 'n'
- The maximum period between refreshes, in hours. See Refresh Values, below.
- exclude = 'page1, page2'
- Supplied with a space- or comma-delimited list of page names, will exclude these from the results. Because multiple instances of the plugin may be running simultaneously, this is a cumulative set.
- debug = 'true|false'
- displays more detailed debugging information about what's happening
Refresh Values#
Forces an update of the list on a random period between a minimum of 15 minutes and a maximum of set by the refresh parameter. If a value is:- not specified : the default value used for the maximum refresh rate is 24 hours
- negative : no limits are set and this acts as a query to return the existing schedule
- zero : sets a random period between 30 sec and 1 minute (recommended for testing only)
Since there's not much sense in permitting enormous values for this parameter its maximum is 168 (1 week, 24 times 7).
Notes#
The basic idea for the RandomPagesPlugin comes from the RandomPages page on MeatballWiki:
Some things I've learnt about running a RandomPages script:
- Randomize the number of pages. This gives some days broader scope than others. Narrower scope allows readers to hit every page. Broader scope increases the probability that something will be of interest. 5 to 20 pages is a good range.
- Run the script infrequently. About once a day is good.
- Run the script at random times. Don't run it at noon every day, but at 10:37am one day, 2:42pm the next.
- Let the RandomPages script float in RecentChanges.
- It is worth noting the kinds of pages that come up in RandomPages. It will give you a feel for what the real interests are of the community.
- Don't be discouraged if not many people read it or if not many discussions flow from it. This is how your mind works. You ignore most of the random thoughts you have, but occasionally you run with one. This happens too with RandomPages.
-- SunirShah
[30 October 2000] I've stopped the script. I have to fix it.
References#
- Calculating Java dates: Take the time to learn how to create and use dates,
Robert Nielsen, JavaWorld.com, 12/29/00 - Working in Java time: Learn the basics of calculating elapsed time in Java,
Robert Nielsen, JavaWorld.com, 03/30/01 - Losing Time on the Garden Path: Calculating the Difference Between Two Datetime Stamps,
Paul Hill, August 2004
Test#
A query on an existing schedule:
[{RandomPages debug='true' refresh='-1'}]
Robot Design
Subsumption Architecture
I 2 C
How To Find Out How Hot Your Pi Is
Microprocessors And Microcontrollers
Alphabot 2
(query)
pages: min=5; max=10; current=7
period: min=900s; max=86400s next=67096s
exclusions: SandBox, LeftMenu, RecentChanges, LeftMenuFooter, Welcome, Main
next refresh: 21 Nov, 09:30:47 UTC (remaining: 00:44:52)
A typical call for test schedule (30s - 1min), maxpages at minimum permitted:
[{RandomPages debug='true' refresh='0' maxpages='5' exclude='Main,Welcome,LeftMenu,RecentChanges,SandBox,LeftMenuFooter'}]
Robot Design
Subsumption Architecture
I 2 C
How To Find Out How Hot Your Pi Is
Microprocessors And Microcontrollers
Alphabot 2
[{RandomPages maxpages='3' exclude='Main,Welcome,LeftMenu,RecentChanges,SandBox,LeftMenuFooter'}]
Robot Design
Subsumption Architecture
I 2 C
How To Find Out How Hot Your Pi Is
Microprocessors And Microcontrollers
Alphabot 2
Tag 'Ne Wiki Plugin' undefined (page does not exist)