User:Tanqbot/smallcovers.js

function getSmallCovers { var url = '/w/api.php?action=query&list=categorymembers&cmtitle=Category:Album_covers&cmnamespace=6&cmlimit=10&cmprop=title&format=json'; var list=[]; $.ajax({		url: url,		dataType: 'json',		async: false,		success: function(data) {				var counter=0;				for (var i in data.query.categorymembers) {					if(typeof(data.query.categorymembers[i].title) != 'undefined') {						list[counter]=data.query.categorymembers[i].title;						counter++;					};				};			}	}); var smallfiles=''; for(var i=0; i300) smallfiles+='* '+list[i]+'\n'; };	alert(smallfiles); };

function getDimensions(fileName) { var url = '/w/api.php?action=query&list=allimages&ailimit=1&aiprop=dimensions&aifrom='+fileName+'&format=json'; var width; $.ajax({		url: url,		dataType: 'json',		async: false,		success: function(data) { width = data.query.allimages[Object.keys(data.query.allimages)].width; }	}); return width; };

// $(document).ready(getSmallCovers);