MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/API

action=compare

(main | compare)
  • Denna modul kräver läsrättigheter.
  • Source: MediaWiki
  • License: GPL-2.0+

Hämta skillnaden mellan två sidor.

Ett versionsnummer, en sidtitel, ett sid-ID, text eller en relativ referens för både "from" och "to" måste godkännas.

Parametrar:
fromtitle

Första titeln att jämföra.

fromid

Första sid-ID att jämföra.

Type: integer
fromrev

Första version att jämföra.

Type: integer
fromtext

Använd denna text istället för innehållet i sidversionen som anges i fromtitle, fromid eller fromrev.

frompst

Do a pre-save transform on fromtext.

Type: boolean (details)
fromcontentformat

Content serialization format of fromtext.

Ett av följande värden: text/x-wiki, text/javascript, application/json, text/css, text/plain
fromcontentmodel

Innehållsmodell för fromtext. Om det inte anges kommer den gissas fram baserat på de andra parametrarna.

Ett av följande värden: wikitext, javascript, json, css, text
totitle

Andra titeln att jämföra.

toid

Andra sid-ID att jämföra.

Type: integer
torev

Andra version att jämföra.

Type: integer
torelative

Use a revision relative to the revision determined from fromtitle, fromid or fromrev. All of the other 'to' options will be ignored.

Ett av följande värden: prev, next, cur
totext

Use this text instead of the content of the revision specified by totitle, toid or torev.

topst

Do a pre-save transform on totext.

Type: boolean (details)
tocontentformat

Content serialization format of totext.

Ett av följande värden: text/x-wiki, text/javascript, application/json, text/css, text/plain
tocontentmodel

Content model of totext. If not supplied, it will be guessed based on the other parameters.

Ett av följande värden: wikitext, javascript, json, css, text
prop

Which pieces of information to get.

diff
The diff HTML.
diffsize
The size of the diff HTML, in bytes.
rel
The revision IDs of the revision previous to 'from' and after 'to', if any.
ids
The page and revision IDs of the 'from' and 'to' revisions.
title
The page titles of the 'from' and 'to' revisions.
user
The user name and ID of the 'from' and 'to' revisions.
comment
The comment on the 'from' and 'to' revisions.
parsedcomment
The parsed comment on the 'from' and 'to' revisions.
size
The size of the 'from' and 'to' revisions.
Värden (separerade med | eller alternativ): diff, diffsize, rel, ids, title, user, comment, parsedcomment, size
Default: diff|ids|title
Example:
Skapa en diff mellan version 1 och 2
api.php?action=compare&fromrev=1&torev=2 [open in sandbox]