Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd67e79

Browse files
zaycodesbrendajerop
authored andcommitted
Added Sample codes for API:Filearchive
1 parent7da96fb commitcd67e79

File tree

9 files changed

+125
-0
lines changed

9 files changed

+125
-0
lines changed

‎javascript/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ Code snippets in Javascript demonstrating how to use various modules of the [Med
101101
*[deleted_revisions.js](deleted_revisions.js): Get a list of deleted revisions for Talk:Main Page.
102102
*[API:Revisiondelete](https://www.mediawiki.org/wiki/API:Revisiondelete)
103103
*[revision_delete.js](revision_delete.js): Hide all information about a certain revision ID.
104+
*[API:Filearchive](https://www.mediawiki.org/wiki/API:Filearchive)
105+
*[file_archive.js](file_archive.js): Get a list of all deleted files.
104106

105107
###Search
106108
*[API:Search](https://www.mediawiki.org/wiki/API:Search)

‎javascript/file_archive.js‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//This file is autogenerated. See modules.json and autogenerator.py for details
2+
3+
/*
4+
file_archive.js
5+
6+
MediaWiki API Demos
7+
Demo of `Filearchive` module: Get a list of all deleted files.
8+
9+
MIT License
10+
*/
11+
12+
varurl="https://en.wikipedia.org/w/api.php";
13+
14+
varparams={
15+
action:"query",
16+
list:"filearchive",
17+
format:"json"
18+
};
19+
20+
url=url+"?origin=*";
21+
Object.keys(params).forEach(function(key){url+="&"+key+"="+params[key];});
22+
23+
fetch(url)
24+
.then(function(response){returnresponse.json();})
25+
.then(function(response){console.log(response);})
26+
.catch(function(error){console.log(error);});

‎mediawikijs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ These code snippets are usefull to create Userscripts and Gadgets.
165165
*[deleted_revisions.js](deleted_revisions.js): Get a list of deleted revisions for Talk:Main Page.
166166
*[API:Revisiondelete](https://www.mediawiki.org/wiki/API:Revisiondelete)
167167
*[revision_delete.js](revision_delete.js): Hide all information about a certain revision ID.
168+
*[API:Filearchive](https://www.mediawiki.org/wiki/API:Filearchive)
169+
*[file_archive.js](file_archive.js): Get a list of all deleted files.
168170

169171
###Search
170172
*[API:Search](https://www.mediawiki.org/wiki/API:Search)

‎mediawikijs/file_archive.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// This file is autogenerated. See modules.json and autogenerator.py for details
2+
3+
/*
4+
file_archive.js
5+
6+
MediaWiki API Demos
7+
Demo of `Filearchive` module: Get a list of all deleted files.
8+
9+
MIT License
10+
*/
11+
12+
varparams={
13+
action:'query',
14+
list:'filearchive',
15+
format:'json'
16+
},
17+
api=newmw.Api();
18+
19+
api.get(params).done(function(data){
20+
console.log(data);
21+
});

‎modules.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@
633633
"action":"query",
634634
"titles":"Image:1995.jpg|Image:Welcome.gif",
635635
"prop":"duplicatefiles",
636+
"format":"json"
636637
}
637638
},
638639
{
@@ -701,5 +702,15 @@
701702
"type":"csrf",
702703
"format":"json"
703704
}
705+
},
706+
{
707+
"filename":"file_archive",
708+
"docstring":"Demo of `Filearchive` module: Get a list of all deleted files.",
709+
"endpoint":"https://en.wikipedia.org/w/api.php",
710+
"params": {
711+
"action":"query",
712+
"list":"filearchive",
713+
"format":"json"
714+
}
704715
}
705716
]

‎php/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ Code snippets in PHP demonstrating how to use various modules of the [MediaWiki
169169
*[deleted_revisions.php](deleted_revisions.php): Get a list of deleted revisions for Talk:Main Page.
170170
*[API:Revisiondelete](https://www.mediawiki.org/wiki/API:Revisiondelete)
171171
*[revision_delete.php](revision_delete.php): Hide all information about a certain revision ID.
172+
*[API:Filearchive](https://www.mediawiki.org/wiki/API:Filearchive)
173+
*[file_archive.php](file_archive.php): Get a list of all deleted files.
174+
172175
###Search
173176
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
174177
*[search.php](search.php): search for a title or a text

‎php/file_archive.php‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
//This file is autogenerated. See modules.json and autogenerator.py for details
4+
5+
/*
6+
file_archive.php
7+
8+
MediaWiki API Demos
9+
Demo of `Filearchive` module: Get a list of all deleted files.
10+
11+
MIT License
12+
*/
13+
14+
$endPoint ="https://en.wikipedia.org/w/api.php";
15+
$params = [
16+
"action" =>"query",
17+
"list" =>"filearchive",
18+
"format" =>"json"
19+
];
20+
21+
$url =$endPoint ."?" .http_build_query($params );
22+
23+
$ch =curl_init($url );
24+
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true );
25+
$output =curl_exec($ch );
26+
curl_close($ch );
27+
28+
$result =json_decode($output,true );
29+
var_dump($result );

‎python/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ Code snippets in Python demonstrating how to use various modules of the [MediaWi
175175
*[deleted_revisions.py](deleted_revisions.py): Get a list of deleted revisions for Talk:Main Page.
176176
*[API:Revisiondelete](https://www.mediawiki.org/wiki/API:Revisiondelete)
177177
*[revision_delete.py](revision_delete.py): Hide all information about a certain revision ID.
178+
*[API:Filearchive](https://www.mediawiki.org/wiki/API:Filearchive)
179+
*[file_archive.py](file_archive.py): Get a list of all deleted files.
178180

179181
###Search
180182
*[API:Search](https://www.mediawiki.org/wiki/API:Search)

‎python/file_archive.py‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#This file is auto-generated. See modules.json and autogenerator.py for details
2+
3+
#!/usr/bin/python3
4+
5+
"""
6+
file_archive.py
7+
8+
MediaWiki API Demos
9+
Demo of `Filearchive` module: Get a list of all deleted files.
10+
11+
MIT License
12+
"""
13+
14+
importrequests
15+
16+
S=requests.Session()
17+
18+
URL="https://en.wikipedia.org/w/api.php"
19+
20+
PARAMS= {
21+
"action":"query",
22+
"list":"filearchive",
23+
"format":"json"
24+
}
25+
26+
R=S.get(url=URL,params=PARAMS)
27+
DATA=R.json()
28+
29+
print(DATA)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp