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

Commit3e4900e

Browse files
zaycodesbrendajerop
authored andcommitted
Added Sample codes for API:Feedrecentchanges
1 parent98910db commit3e4900e

File tree

9 files changed

+122
-3
lines changed

9 files changed

+122
-3
lines changed

‎javascript/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ Code snippets in Javascript demonstrating how to use various modules of the [Med
105105
*[file_archive.js](file_archive.js): Get a list of all deleted files.
106106
*[API:Fileusage](https://www.mediawiki.org/wiki/API:Fileusage)
107107
*[get_file_usage.js](get_file_usage.js): Get a list of pages using a given file.
108+
*[API:Feedrecentchanges](https://www.mediawiki.org/wiki/API:Feedrecentchanges)
109+
*[get_feed_recent_changes.js](get_feed_recent_changes.js): Show recent changes as an RSS feed.
108110

109111
###Search
110112
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//This file is autogenerated. See modules.json and autogenerator.py for details
2+
3+
/*
4+
get_feed_recent_changes.js
5+
6+
MediaWiki API Demos
7+
Demo of `Feedrecentchanges` module: Show recent changes as an RSS feed.
8+
9+
MIT License
10+
*/
11+
12+
varurl="https://en.wikipedia.org/w/api.php";
13+
14+
varparams={
15+
action:"feedrecentchanges",
16+
format:"json"
17+
};
18+
19+
url=url+"?origin=*";
20+
Object.keys(params).forEach(function(key){url+="&"+key+"="+params[key];});
21+
22+
fetch(url)
23+
.then(function(response){returnresponse.json();})
24+
.then(function(response){console.log(response);})
25+
.catch(function(error){console.log(error);});

‎mediawikijs/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ These code snippets are usefull to create Userscripts and Gadgets.
169169
*[file_archive.js](file_archive.js): Get a list of all deleted files.
170170
*[API:Fileusage](https://www.mediawiki.org/wiki/API:Fileusage)
171171
*[get_file_usage.js](get_file_usage.js): Get a list of pages using a given file.
172+
*[API:Feedrecentchanges](https://www.mediawiki.org/wiki/API:Feedrecentchanges)
173+
*[get_feed_recent_changes.js](get_feed_recent_changes.js): Show recent changes as an RSS feed.
172174

173175
###Search
174176
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This file is autogenerated. See modules.json and autogenerator.py for details
2+
3+
/*
4+
get_feed_recent_changes.js
5+
6+
MediaWiki API Demos
7+
Demo of `Feedrecentchanges` module: Show recent changes as an RSS feed.
8+
9+
MIT License
10+
*/
11+
12+
varparams={
13+
action:'feedrecentchanges',
14+
format:'json'
15+
},
16+
api=newmw.Api();
17+
18+
api.get(params).done(function(data){
19+
console.log(data);
20+
});

‎modules.json‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,22 +704,32 @@
704704
}
705705
},
706706
{
707-
<<<<<<< HEAD
708707
"filename":"file_archive",
709708
"docstring":"Demo of `Filearchive` module: Get a list of all deleted files.",
710709
"endpoint":"https://en.wikipedia.org/w/api.php",
711710
"params": {
712711
"action":"query",
713712
"list":"filearchive",
714-
=======
713+
"format":"json"
714+
}
715+
},
716+
{
715717
"filename":"get_file_usage",
716718
"docstring":"Demo of `Fileusage` module: Get a list of pages using a given file.",
717719
"endpoint":"https://en.wikipedia.org/w/api.php",
718720
"params": {
719721
"action":"query",
720722
"titles":"File:Example.jpg",
721723
"prop":"fileusage",
722-
>>>>>>> Added Sample codes for API:Fileusage
724+
"format":"json"
725+
}
726+
},
727+
{
728+
"filename":"get_feed_recent_changes",
729+
"docstring":"Demo of `Feedrecentchanges` module: Show recent changes as an RSS feed.",
730+
"endpoint":"https://en.wikipedia.org/w/api.php",
731+
"params": {
732+
"action":"feedrecentchanges",
723733
"format":"json"
724734
}
725735
}

‎php/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ Code snippets in PHP demonstrating how to use various modules of the [MediaWiki
173173
*[file_archive.php](file_archive.php): Get a list of all deleted files.
174174
*[API:Fileusage](https://www.mediawiki.org/wiki/API:Fileusage)
175175
*[get_file_usage.php](get_file_usage.php): Get a list of pages using a given file.
176+
*[API:Feedrecentchanges](https://www.mediawiki.org/wiki/API:Feedrecentchanges)
177+
*[get_feed_recent_changes.php](get_feed_recent_changes.php): Show recent changes as an RSS feed.
176178

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

‎php/get_feed_recent_changes.php‎

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

‎python/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Code snippets in Python demonstrating how to use various modules of the [MediaWi
179179
*[file_archive.py](file_archive.py): Get a list of all deleted files.
180180
*[API:Fileusage](https://www.mediawiki.org/wiki/API:Fileusage)
181181
*[get_file_usage.py](get_file_usage.py): Get a list of pages using a given file.
182+
*[API:Feedrecentchanges](https://www.mediawiki.org/wiki/API:Feedrecentchanges)
183+
*[get_feed_recent_changes.py](get_feed_recent_changes.py): Show recent changes as an RSS feed.
182184

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

‎python/get_feed_recent_changes.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#This file is auto-generated. See modules.json and autogenerator.py for details
2+
3+
#!/usr/bin/python3
4+
5+
"""
6+
get_feed_recent_changes.py
7+
8+
MediaWiki API Demos
9+
Demo of `Feedrecentchanges` module: Show recent changes as an RSS feed.
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":"feedrecentchanges",
22+
"format":"json"
23+
}
24+
25+
R=S.get(url=URL,params=PARAMS)
26+
DATA=R.json()
27+
28+
print(DATA)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp