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

Commitd8d2168

Browse files
zaycodesbrendajerop
authored andcommitted
Added Sample codes for API:Feedcontributions
1 parentbb77d4e commitd8d2168

File tree

9 files changed

+122
-0
lines changed

9 files changed

+122
-0
lines changed

‎javascript/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ Code snippets in Javascript demonstrating how to use various modules of the [Med
111111
*[get_feed_recent_changes.js](get_feed_recent_changes.js): Show recent changes as an RSS feed.
112112
*[API:Setnotificationtimestamp](https://www.mediawiki.org/wiki/API:Setnotificationtimestamp)
113113
*[set_notification_timestamp.js](set_notification_timestamp.js): Reset the notification status for the entire watchlist.
114+
*[API:Feedcontributions](https://www.mediawiki.org/wiki/API:Feedcontributions)
115+
*[get_user_contributions_feed.js](get_user_contributions_feed.js): Show contributions of a user as an RSS feed.
114116

115117
###Search
116118
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
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+
get_user_contributions_feed.js
5+
6+
MediaWiki API Demos
7+
Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed.
8+
9+
MIT License
10+
*/
11+
12+
varurl="https://en.wikipedia.org/w/api.php";
13+
14+
varparams={
15+
action:"feedcontributions",
16+
user:"Jimbo Wales",
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
@@ -175,6 +175,8 @@ These code snippets are usefull to create Userscripts and Gadgets.
175175
*[get_feed_recent_changes.js](get_feed_recent_changes.js): Show recent changes as an RSS feed.
176176
*[API:Setnotificationtimestamp](https://www.mediawiki.org/wiki/API:Setnotificationtimestamp)
177177
*[set_notification_timestamp.js](set_notification_timestamp.js): Reset the notification status for the entire watchlist.
178+
*[API:Feedcontributions](https://www.mediawiki.org/wiki/API:Feedcontributions)
179+
*[get_user_contributions_feed.js](get_user_contributions_feed.js): Show contributions of a user as an RSS feed.
178180

179181
###Search
180182
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
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+
get_user_contributions_feed.js
5+
6+
MediaWiki API Demos
7+
Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed.
8+
9+
MIT License
10+
*/
11+
12+
varparams={
13+
action:'feedcontributions',
14+
user:'Jimbo Wales',
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,5 +732,15 @@
732732
"action":"feedrecentchanges",
733733
"format":"json"
734734
}
735+
},
736+
{
737+
"filename":"get_user_contributions_feed",
738+
"docstring":"Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed.",
739+
"endpoint":"https://en.wikipedia.org/w/api.php",
740+
"params": {
741+
"action":"feedcontributions",
742+
"user":"Jimbo Wales",
743+
"format":"json"
744+
}
735745
}
736746
]

‎php/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ Code snippets in PHP demonstrating how to use various modules of the [MediaWiki
179179
*[get_feed_recent_changes.php](get_feed_recent_changes.php): Show recent changes as an RSS feed.
180180
*[API:Setnotificationtimestamp](https://www.mediawiki.org/wiki/API:Setnotificationtimestamp)
181181
*[set_notification_timestamp.php](set_notification_timestamp.php): Reset the notification status for the entire watchlist.
182+
*[API:Feedcontributions](https://www.mediawiki.org/wiki/API:Feedcontributions)
183+
*[get_user_contributions_feed.php](get_user_contributions_feed.php): Show contributions of a user as an RSS feed.
182184

183185
###Search
184186
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
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_user_contributions_feed.php
7+
8+
MediaWiki API Demos
9+
Demo of `Feedcontributions` module: Show contributions of a user as an RSS feed.
10+
11+
MIT License
12+
*/
13+
14+
$endPoint ="https://en.wikipedia.org/w/api.php";
15+
$params = [
16+
"action" =>"feedcontributions",
17+
"user" =>"Jimbo Wales",
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+
var_dump($output );

‎python/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ Code snippets in Python demonstrating how to use various modules of the [MediaWi
185185
*[get_feed_recent_changes.py](get_feed_recent_changes.py): Show recent changes as an RSS feed.
186186
*[API:Setnotificationtimestamp](https://www.mediawiki.org/wiki/API:Setnotificationtimestamp)
187187
*[set_notification_timestamp.py](set_notification_timestamp.py): Reset the notification status for the entire watchlist.
188+
*[API:Feedcontributions](https://www.mediawiki.org/wiki/API:Feedcontributions)
189+
*[get_user_contributions_feed.py](get_user_contributions_feed.py): Show contributions of a user as an RSS feed.
188190

189191
###Search
190192
*[API:Search](https://www.mediawiki.org/wiki/API:Search)
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+
get_user_contributions_feed.py
7+
8+
MediaWiki API Demos
9+
Demo of `Feedcontributions` module: Show contributions of a user 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":"feedcontributions",
22+
"user":"Jimbo Wales",
23+
"format":"json"
24+
}
25+
26+
R=S.get(url=URL,params=PARAMS)
27+
DATA=R.content
28+
29+
print(DATA)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp