WikiFur:Comic of the Week/Candidates/src

From WikiFur, the furry encyclopedia.
Jump to: navigation, search


<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
            'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='content-type'>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
</head>
<body>
<pre>

<script>

function categoryMembers (title) {

   var tresult = [];
   var tcontinue = false;
   do {
       $.ajax({
           dataType: "json",
           url: "http://en.wikifur.com/w/api.php?action=query&list=categorymembers&cmnamespace=0&cmtitle=" + title + "&cmtype=page&cmlimit=500" + (tcontinue == false ? "" : "&cmcontinue=" + tcontinue),
           data: {format: "json"},
           async: false,
           success: function (data) {
               tresult.push (1);
               $.each (data["query"]["categorymembers"], function (key, val) {
                   tresult.push (val["title"].replace ("Talk:", ""));
               });
               if (data["query-continue"] != undefined) {
                   tcontinue = data["query-continue"]["categorymembers"]["cmcontinue"];
               } else {
                   tcontinue = false;
               }
           }
       });
   } while (tcontinue != false);
   return tresult;

}

var comics = categoryMembers ("Category:Comics"); var featured = categoryMembers ("Category:Featured Comic");

comics.shift (); // remove Comics and some junk page comics.shift ();

var tcount = 0;

$.each (comics, function (key, val) {

   if (!tcount) {
       $ ("pre").append ("{| class=\"wikitable sortable\"\n|-\n!Comic\n|Status\n|Bytes\n");
   }
   $ ("pre").append ("|-\n|" + val + "\n|" + ((featured.indexOf (val) == -1) ? "Not Featured" : "") + "\n|0\n");
   if (++tcount > 98) {
       $ ("pre").append ("|}\n\n\n\n\n\n\n\n\n");
       tcount = 0;
   }

});

$ ("pre").append ("|}\n"); </script>


</body> </html>


</pre>