User:BPositive/getPageContent.js

mw.loader.using( 'mediawiki.api', function {    var api_1 = new mw.Api;    api_1.get({ action:'query', prop: 'revisions', format: 'json', rvprop: 'timestamp', rvuser: 'FuzzyBot', titles: 'Help:Special_pages/fr' }).done(function(data){ //FB = FuzzyBot var timestampFB = data['query']['pages']['19563']['revisions'][0]['timestamp']; console.log("Timestamp for FuzzyBot's revision: " + timestampFB); var dateFB = new Date(timestampFB); dateFB.setSeconds( dateFB.getSeconds - 1 ); var timestampOld = dateFB.toISOString; console.log("New Timestamp: " + timestampOld); var api_2 = new mw.Api; api_2.get({	       action:'query',	        prop: 'revisions',	        format: 'json',	        rvprop: 'content',	        rvstart: timestampOld,	        titles: 'Help:Special_pages/fr'	    }).done(function(data){	    	console.log("Revision before FuzzyBot's edit: " + data['query']['pages']['19563']['revisions'][0]['*']);	    }); }); });