Page MenuHomePhabricator

Add #sizeof: function to ParserFunctions extension
Closed, DeclinedPublic

Description

Author: hersfoldwiki

Description:
Someone recently came to me to ask if there was any way to see if a requests page could be transcluded only if there were new requests on it. After working with #ifeq:, we couldn't get it to work, however a #sizeof: function that returns the size of the page in bytes should work well for this application, and could likely be used for other uses as well. This value is already reported in the page history, and I'd think would be easy enough to access with such a function.

What I'm envisioning here (however it works, it works, of course) is something like this:

{{#sizeof:Example}}

where the size of [[Example]] would be returned in the number of bytes (404, in this case, according to the English Wikipedia's page history). Other functions such as #ifeq: could then use this value to make different things happen.

Would something like this be possible, and could it be implemented if so?


Version: unspecified
Severity: enhancement

Details

Reference
bz14851

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:09 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz14851.
bzimport added a subscriber: Unknown Object (MLST).

The {{PAGESIZE:xyz}} magic word is what you're looking for; see http://www.mediawiki.org/wiki/Help:Magic_words#Statistics. For example, it's used for the percentages on [[m:Board_elections/2008/Translation#List]].