API:Filearchive - MediaWiki (original) (raw)
Languages:
| This page is part of the MediaWiki Action API documentation. |
|---|
| MediaWiki version: | ≥ 1.17 |
|---|
GET request to enumerate all deleted files from filearchive table sequentially.
| The following documentation is the output of Special:ApiHelp/query+filearchive, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
|---|
- This module requires read rights.
- Source: MediaWiki
- License: GPL-2.0-or-later
Enumerate all deleted files sequentially.
Specific parameters:
fafrom
The image title to start enumerating from.
fato
The image title to stop enumerating at.
faprefix
Search for all image titles that begin with this value.
fadir
The direction in which to list.
One of the following values: ascending, descending
Default: ascending
fasha1
SHA1 hash of image. Overrides fasha1base36.
fasha1base36
SHA1 hash of image in base 36 (used in MediaWiki).
faprop
Which image information to get:
sha1
Adds SHA-1 hash for the image.
timestamp
Adds timestamp for the uploaded version.
user
Adds user who uploaded the image version.
size
Adds the size of the image in bytes and the height, width and page count (if applicable).
dimensions
Alias for size.
description
Adds description of the image version.
parseddescription
Parse the description of the version.
mime
Adds MIME of the image.
mediatype
Adds the media type of the image.
metadata
Lists Exif metadata for the version of the image.
bitdepth
Adds the bit depth of the version.
archivename
Adds the filename of the archive version for non-latest versions.
Values (separate with | or alternative): archivename, bitdepth, description, dimensions, mediatype, metadata, mime, parseddescription, sha1, size, timestamp, user
Default: timestamp
falimit
How many images to return in total.
Type: integer or max
The value must be between 1 and 500.
Default: 10
facontinue
When more results are available, use this to continue. More detailed information on how to continue queries can be found on mediawiki.org.
Get a list of all deleted files.
{ "batchcomplete": "", "continue": { "facontinue": "0000007.jpg|20070128133944|288", "continue": "-||" }, "query": { "filearchive": [ { "id": 1778, "name": "!notedit.png", "ns": 6, "title": "File:!notedit.png", "timestamp": "2011-04-25T13:17:47Z" }, { "id": 6949, "name": ""Twilight_at_the_pond"by_A.A.Tutunov(1976).jpg", "ns": 6, "title": "File:"Twilight at the pond" by A.A.Tutunov (1976).jpg", "timestamp": "2019-01-26T11:48:52Z" }, { "id": 5814, "name": "---C--temp-Regelwerk.pdf", "ns": 6, "title": "File:---C--temp-Regelwerk.pdf", "timestamp": "2017-03-09T10:09:24Z" }, ... ] } }
#!/usr/bin/python3
""" file_archive.py
MediaWiki API Demos
Demo of `Filearchive` module: Get a list of all deleted files.
MIT License"""
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PARAMS = { "action": "query", "list": "filearchive", "format": "json" }
R = S.get(url=URL, params=PARAMS) DATA = R.json()
print(DATA)
"query", "list" => "filearchive", "format" => "json" ]; url=url = url=endPoint . "?" . http_build_query( $params ); ch=curlinit(ch = curl_init( ch=curlinit(url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); output=curlexec(output = curl_exec( output=curlexec(ch ); curl_close( $ch ); result=jsondecode(result = json_decode( result=jsondecode(output, true ); var_dump( $result ); /* file_archive.js MediaWiki API Demos Demo of `Filearchive` module: Get a list of all deleted files. MIT License */ var url = "https://en.wikipedia.org/w/api.php"; var params = { action: "query", list: "filearchive", format: "json" }; url = url + "?origin=*"; Object.keys(params).forEach(function(key){url += "&" + key + "=" + params[key];}); fetch(url) .then(function(response){return response.json();}) .then(function(response) {console.log(response);}) .catch(function(error){console.log(error);}); /* file_archive.js MediaWiki API Demos Demo of `Filearchive` module: Get a list of all deleted files. MIT License */ var params = { action: 'query', list: 'filearchive', format: 'json' }, api = new mw.Api(); api.get( params ).done( function ( data ) { console.log( data ); } ); | Code | Info | | ---------------------------- | ---------------------------------------------------------------- | | cantview-deleted-description | You don't have permission to view descriptions of deleted files. | | cantview-deleted-metadata | You don't have permission to view metadata of deleted files. | | invalidsha1hash | The SHA1 hash provided is not valid. | | invalidsha1base36hash | The SHA1Base36 hash provided is not valid. | * v1.20: Introduced `facontinue`, `mediatype`, `archivename` * v1.18: Introduced `fato`, `fasha1`, `fasha1base36`, `parseddescription`