API:Deletedrevs/fr
Cette page fait partie de la documentation de l'API MediaWiki Action. |
Version de MediaWiki : | ≤ 1.25 |
(obsolète depuis v. 1.25) The API documentation described here will work best with MediaWiki 1.14 and earlier. It has been deprecated in favor of
alldeletedrevisions
apiGET request to list deleted revisions.
Documentation de l'API
Exemple
Requête GET
List the 6 most recent deleted revisions from user Catrope dated September 4, 2007.
api.php? action=query& list=deletedrevs& drstart=20070904235959& drend=20070904000000& drprop=revid|user|minor|len|token& drlimit=6& druser=Catrope& format=json [Essayez !]
Réponse
<?xml version="1.0" encoding="utf-8"?>
<api>
<query-continue>
<deletedrevs drstart="20070904142729" />
</query-continue>
<query>
<deletedrevs>
<page title="Main Page" ns="0" token="e4c475f13be7824135b4edbebf4140ff+\">
<revisions>
<rev timestamp="20070904200804" revid="31" user="Catrope" minor="" len="" />
<rev timestamp="20070904200753" revid="30" user="Catrope" minor="" len="" />
<rev timestamp="20070904193501" revid="29" user="Catrope" minor="" len="568" />
<rev timestamp="20070904193213" revid="28" user="Catrope" minor="" len="470" />
</revisions>
</page>
<page title="User:Catrope" ns="2" token="e4c475f13be7824135b4edbebf4140ff+\">
<revisions>
<rev timestamp="20070904143938" revid="24" user="Catrope" len="52" />
<rev timestamp="20070904142758" revid="23" user="Catrope" len="37" />
</revisions>
</page>
</deletedrevs>
</query>
</api>
Exemple de code
get_deleted_revisions.py
#!/usr/bin/python3
"""
get_deleted_revisions.py
MediaWiki Action API Code Samples
Demo of `Deletedrevs` module: List the six most recent deleted revisions
from User:Catrope
MIT License
"""
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PARAMS = {
"drend": "20070904000000",
"format": "json",
"druser": "Catrope",
"list": "deletedrevs",
"drstart": "20070904235959",
"drlimit": "6",
"drprop": "revid|user|minor|len|token",
"action": "query"
}
R = S.get(url=URL, params=PARAMS)
DATA = R.json()
print(DATA)
Erreurs possibles
Code | Info |
---|---|
drpermissiondenied | You don't have permission to view deleted revision information. On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have different rules. |
Historique des paramètres
- v1.24: Deprecated
drprop: token
- v1.23: Introduced
drtag
,drprop: tags
- v1.19: Introduced
drprop: sha1
- v1.18: Introduced
drto
,drprefix
,drprop: parentid
- v1.17: Introduced
drprop: userid
- v1.16: Introduced
drprop: parsedcomment
- v1.15: Introduced
druser
,drexcludeuser
,drnamespace
,drunique
,drfrom
Notes supplémentaires
- This module cannot be used as a generator .
- You need the
deletedhistory
right to use this module.
This module can be used in one of three modes:
- List deleted revisions for the given titles (through
titles
or a generator), sorted by timestamp
- List deleted revisions for the given titles (through
- List deleted contributions for a certain user, sorted by timestamp (
druser
set, no titles given)
- List deleted contributions for a certain user, sorted by timestamp (
- List all deleted revisions in a certain namespace (
druser
not set, no titles given)
- List all deleted revisions in a certain namespace (
- Some parameters are restricted to certain modes only, and are marked accordingly.