开发者

Work out percentage of change done by one person on MediaWiki

开发者 https://www.devze.com 2023-04-12 05:40 出处:网络
I would like to work out the percentage of editing/change that one person has done to one article, so I can send out donations accordingly.

I would like to work out the percentage of editing/change that one person has done to one article, so I can send out donations accordingly.

How do I do开发者_如何学C this automatically? (preferably in PHP)


The editing history is stored in the revision table. If you have the page-id you can get the percentage of user edits by page (just replace the 1 with the page-id):

SELECT
    rev_user, rev_user_text,
    count(*) as rev_user_count,
    (SELECT count(*) FROM revision WHERE rev_page = 1) as rev_total_count,
    100 * count(*)/(SELECT count(*) FROM revision WHERE rev_page = 1) as rev_percent
FROM revision
WHERE rev_page = 1
GROUP BY rev_user
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号