Page MenuHomePhabricator

Please create %%wordcount%%, %%linkcount%%, %%imagecount%%, %%categorycount%%, %%interwikicount%%
Closed, ResolvedPublic

Description

These variables are already displayed in the Start tab's 'Page statistics' box. Having them as keywords, like %%pagetitle%%, would be very helpful (particularly %%wordcount%%).

Event Timeline

Why would you want to substitute them in?

Mostly due to this comment (to help find pages potentially mis-classified as non-stubs via %%wordcount%%).

Why would you want them in the page though?

I'd add %%wordcount%% (or whichever keyword) temporarily to the page to assist with processing. If greater than some #, or some # of digits, I skip the page. If less than some #, or some # of digits, I operate on the page.

This will probably require re-parsing the page, but it is doable. It would be useful if keywords (temporary or permanent) placed by the custom module were evaluated. That way, I could temp-add %%wordcount%% via the custom module, then use the advanced rules to evaluate it. Currently, for example, if I add %%pagename%% via both the custom module and via advanced rules, only the advanced rules' instance is evaluated. Is that on purpose?

I could workaround this entirely (not to obviate this request though) by calculating wordcount directly in the custom module by copying the relevant code. Would that be possible and, if so, could you point me to it?

Tools.WordCount(articleText) in a CustomModule should work

Well shit, that's great! Indeed it does!

Tom.Reding claimed this task.

Tools.WordCount(ArticleText)