MediaWiki API 帮助

这是自动生成的MediaWiki API文档页面。

文档和例子:https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=wordcounter

main | wordcounter
  • 此模块需要读取权限。
  • 来源:WordCounter
  • 许可协议:MIT

The API module of the 'WordCounter' extension for counting words in the wiki.

The 'WordCounter' API module provides functions to retrieve word counts for individual pages, list pages by word count, and provide overall statistics about words in the wiki.

具体参数:
其他通用参数可用。
prop

Properties provided by the module:

totals
Returns global statistics about words in pages.
pagewords
Queries the word count of one or more pages.
listpages
(没有说明)
uncounted
Lists pages whose words have not been counted.
这个参数是必需的。
值(以|替代物分隔):listpages、​pagewords、​totals、​uncounted
titles

A list of page titles for which to query word counts.

通过|替代物隔开各值。
值的最大值为50(允许更高上限的客户端为500)。
pageids

A list of page IDs for which to query word counts.

类型:整数列表
通过|替代物隔开各值。
值的最大值为50(允许更高上限的客户端为500)。
namespaces

A list of namespace IDs to consider in the query.

类型:整数列表
通过|替代物隔开各值。
值的最大值为50(允许更高上限的客户端为500)。
limit

Maximum number of results to return.

类型:整数或max
值必须介于1和500之间。
默认:50
offset

Offset for the results to enable pagination.

类型:整数
值必须不少于0。
默认:0
sort

Sort order of the results. Possible values are 'asc' (ascending) and 'desc' (descending).

以下值中的一个:asc、​desc
默认:desc
例子:
Retrieves the total word statistics of the wiki.
api.php?action=wordcounter&prop=totals [在沙盒中打开]
Queries the word count for one or more pages by their titles.
api.php?action=wordcounter&prop=pagewords&titles=Main_Page [在沙盒中打开]
Queries the word count for one or more pages by their IDs.
api.php?action=wordcounter&prop=pagewords&pageids=1|2|3 [在沙盒中打开]
Lists pages sorted by word count.
api.php?action=wordcounter&prop=listpages&limit=10&sort=desc [在沙盒中打开]
Lists pages sorted by word count, considering the specified namespaces.
api.php?action=wordcounter&prop=listpages&limit=10&namespaces=0 [在沙盒中打开]
Lists pages whose words have not been counted.
api.php?action=wordcounter&prop=uncounted&limit=100 [在沙盒中打开]