Widget:Editedarticles


 * 1) edited_widget {display: none;}

var editedarticles = {

/**    * input variables from the widget */   number: ,

/**    * get API response from the server *    * return html output */   getAPI : function {

output = "";

urlAPI = "/api.php?action=query&list=recentchanges&rctype=edit&rctoponly&rcnamespace=0&rcprop=title|timestamp&rcshow=!minor|!redirect&format=json&rclimit=" + editedarticles.number;

$.ajax({           url: urlAPI        }).done(function(data){

// number of edits numberEdits = data.query.recentchanges.length;

// if no edit, exit if (numberEdits == 0) { $("#editedarticles_warning").html("No edits found in the specified period.") return false; }

output = ""; data.query.recentchanges.forEach(function(a) {             date = new Date(a.timestamp);              output += '' + a.title + " (" + date.getDate + "." + (date.getMonth + 1) + "." + date.getFullYear + " " + (date.getHours < 10 ? "0" : "") + date.getHours + ":" + (date.getMinutes < 10 ? "0" : "") + date.getMinutes + ")";           }); output += "";

// show results $("#editedarticles_widget").html(output); $("#editedarticles_widget").show("fast"); $("#editedarticles_warning").html(""); });

},

startIt : function {

if(window.jQuery) { $(function {editedarticles.getAPI;}); } else { setTimeout(editedarticles.startIt, 100); }

}

}

editedarticles.startIt;



Loading data&hellip;

This widget is designed to retrieve links to several recently edited articles on the wiki.

Usage
Insert the following code:

and you will see the 3 most recently edited articles:

The  parameter specifies the number of displayed articles, by default 5.

License
The source code of this widget is released under the GNU General Public License 3.0.