Page MenuHomePhabricator

Enable article count in Txikipedia namespace
Closed, InvalidPublic

Description

Hello,
Currently we can't count items in Namespace Txikipedia, as we can only do it via a category. But articles in category count also counts categories in categories, templates and so on. Would it be possible to enable article count per namespace?

Event Timeline

Theklan created this task.Apr 11 2018, 5:45 PM

You probably can count them with a SQL query on quarry.wmflabs.org:

SELECT COUNT(*)
FROM page
WHERE page_namespace = 104 AND page_is_redirect = 0;

But if you wish something more like MediaWiki does, you can filter the pages to include only those with one link (ie you don't count orphaned page):

SELECT COUNT(DISTINCT(page_id))
FROM pagelinks
INNER JOIN page ON pl_from = page_id
WHERE page_namespace = 104
AND page_is_redirect = 0;

Reference: https://www.mediawiki.org/wiki/Manual:Article_count

Is it possible to include this result in a Wikimedia page?

You can create a bot and update the count once a hour/day/week/month/whatever. Or, maybe you can create a Lua script that will provide you a function to return the number on demand. @matej_suchanek can help you with Lua modules if you want.

Quarry let you export the resultset table in wikicode, that you can copy/paste to a wikipage. Note that it's not yet possible to automatically re-execute a quarry periodically (T101835).

I think that we can close this task as invalid, since nothing can be done in the Wikimedia-Site-requests project.

Theklan closed this task as Invalid.May 2 2018, 9:07 AM

Ok... if there's no solution, we could mark it as invalid.