Jump to content

法律:维基媒体基金会使用条款的机器可读性与交互性

From Wikimedia Foundation Governance Wiki
This page is a translated version of the page Legal:Wikimedia Foundation Terms of Use Machine Readability and Interaction and the translation is 27% complete.

维基媒体基金会使用条款(“TOU”)提供机器可读格式。

值得注意的是,我们提供了一个功能强大的应用程序编程接口,可用于以多种方式提取、处理和提供使用条款(以及我们托管的其他页面)。

一个简单直接的操作是将文本(不含 HTML 格式)提取出来,并将其作为 XML 文件返回:https://foundation.wikimedia.org/w/api.php?action=query&prop=extracts&titles=Policy:Terms_of_Use&explaintext=1&format=xml

You can also retrieve just specific sections of the TOU, for example: https://foundation.wikimedia.org/w/api.php?action=query&prop=revisions&titles=Policy:Terms_of_Use&rvslots=main&rvprop=content&rvsection=8&format=xml (change the number after "rvsection", in this URL, in order to retrieve different sections. The section numbering is available from this link: https://foundation.wikimedia.org/w/api.php?action=parse&page=Policy:Terms_of_Use&prop=sections&format=xml (see the corresponding entry for "number", for the section you are looking for).

Other available formats, besides XML, include json, jsonfm, php, phpfm, rawfm, and xmlfm.

There is a whole lot more that the MediaWiki Actions API can do! The main API documentation is available at MediaWiki.org, and a helpful API Sandbox tool (to guide you through interacting with the API) is available on this wiki.

Worked example

Let us imagine you wish to retrieve the Termination provisions of the TOU, in JSON format.

At the time of writing, the Termination section currently has index number "14", according to https://foundation.wikimedia.org/w/api.php?action=parse&page=Policy:Terms_of_Use&prop=sections&format=xml

The following link - which uses 14 after the "rvsection", and "json" as the format - will therefore return the Termination provisions of the current TOU in JSON format: https://foundation.wikimedia.org/w/api.php?action=query&prop=revisions&titles=Policy:Terms_of_Use&rvslots=main&rvprop=content&rvsection=14&format=json

Other possibilities

Other tools are available to leverage the machine-readability of our Terms of Use.

For example, you can use the Page History tool to automatically generate a comparison between different (archived) versions of the TOU; for help using it, see here.


Use of our software and APIs is subject to applicable terms and policies.