API:Get the contents of a page/pl

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page API:Get the contents of a page and the translation is 31% complete.
Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎polski • ‎português do Brasil • ‎русский • ‎中文 • ‎日本語 • ‎한국어

There are three main methods for retrieving page content via the API:

  1. Get the contents of a page using the Revisions API (as wikitext).
  1. Get the contents of a page using the Parse API (as HTML or wikitext).
  1. Get plain text or limited HTML extracts of a page using the API of the TextExtracts extension.

The Revisions API can be used to retrieve the content of a page as wikitext. This can be done by specifying the title of the page in the titles parameter and setting the rvprop parameter to content. For more options, see API:Revisions .

Przykłady

GET request to obtain the wikitext content of the page Pet door.


Odpowiedź

Method 2: Use the Parse API

The Parse API can be used to retrieve page content in either HTML format (parsed) or Wikitext format (unparsed). This can be done by specifying a page with the page parameter or a revision with the oldid parameter. To retrieve HTML, set prop to text. To retrieve Wikitext, set prop to wikitext.

Przykład 1

GET request to get parsed HTML content of a page: Pet door


Odpowiedź

Przykład 2

GET request to get the original wikitext content of a page: Pet door


Odpowiedź

Method 3: Use the TextExtracts API

Note that the TextExtracts extension must be installed on the wiki in order to use this method. To see if it is installed, go to Special:Version on the wiki you are targeting.

The TextExtracts extension provides an API which allows you to retrieve plain-text or limited HTML extracts of page content. Zobacz Extension:TextExtracts#API , aby uzyskać więcej szczegółów.

Przykład

Get request to extract 10 sentences from the page w:Pet door.


Odpowiedź

Dodatkowe informacje

The content extracted directly from Wikipedia can be inserted into any MediaWiki wiki through Extension:InterwikiExtracts . The content extracted comes in the form of limited wikitext, omitting leading templates, links to files or pages.

Zobacz też