Template talk:Pagecount

-
Jump to: navigation, search

Usage is: {{pagecount|xx}} to display the number of content pages for language code xx.

Hey, kids!

You can generate this completely useless template in your own home by following this li'l recipe:

<?php
$wiki = array(
        "af" => "http://niesiklopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ar" => "http://beidipedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ast" => "http://nunyepedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "bar" => "http://stupidedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "be" => "http://paudurapedyja.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "bg" => "http://bg.oxypedia.net/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "bn" => "http://bn.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "bs" => "http://bs.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ca" => "http://valenciclopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "cs" => "http://necyklopedie.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "cy" => "http://cy.uncyclopedia.org.uk/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "da" => "http://spademanns.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "dlm" => "http://dlm.neciklopedija.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "de" => "http://de.uncyclopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "el" => "http://anegkyklopaideia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "en" => "http://uncyclopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "eo" => "http://neciklopedio.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "es" => "http://inciclopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "et" => "http://ebatsuklopeedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "fa" => "http://fa.uncyclopaedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "fi" => "http://hikipedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "fr" => "http://desencyclopedie.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ga" => "http://ga.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "gl" => "http://desgalipedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "got" => "http://got.uncyclopedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "grc" => "http://kakapedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "he" => "http://eincyclopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "hr" => "http://hr.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "hu" => "http://unciklopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "hy" => "http://angragitaran.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "id" => "http://tolololpedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "it" => "http://nonciclopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ja" => "http://ja.uncyclopedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "jv" => "http://ndhablek.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ka" => "http://anciklopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "km" => "http://km.uncyclopedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ko" => "http://uncyclopedia.kr/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "la" => "http://uncapaedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "lb" => "http://kengencyclopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "li" => "http://kwatsjpedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "lo" => "http://lo.uncyclopedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "lt" => "http://juokopedija.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "lv" => "http://lv.neciklopedija.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "meta" => "http://uncyclomedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "mg" => "http://hatsiklopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "mk" => "http://mk.neciklopedija.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "mo" => "http://uichipedia.net/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ms" => "http://bodohpedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "mwl" => "http://cciclopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "nds" => "http://kamelopedia.mormo.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "nl" => "http://oncyclopedia.net/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "nn" => "http://ikkjepedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "no" => "http://ikkepedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "oc" => "http://oisquipedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "pl" => "http://nonsensopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "pt" => "http://desciclopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ro" => "http://uncyclopedia.ro/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "ru" => "http://absurdopedia.net/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "sco" => "http://scotypedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "simple" => "http://simple.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "sk" => "http://necyklopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "sl" => "http://slovo.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "sr" => "http://sr.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "su" => "http://su.goblogpedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "sv" => "http://sv.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "th" => "http://th.uncyclopedia.info/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "tl" => "http://pekepedia.net/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "tlh" => "http://tlh.uncyc.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "tr" => "http://yansiklopedi.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "uk" => "http://inciklopedia.org/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "yi" => "http://keinziklopedie.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "zhcn" => "http://zh.uncyclopedia.wikia.com/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "zhhk" => "http://uncyclopedia.hk/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "zhtw" => "http://uncyclopedia.tw/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml",
        "zombie" => "http://zombie.pedia.ws/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml");

 $stats = array();
 print "{{-start-}}<noinclude>\n'''Template:Pagecount'''\nPagecount statistics for each language wiki xx, invoke using: {{pagecount|xx}}\n</noinclude>";
 print "{{#switch: {{{1}}}\n";
 foreach ($wiki as $wiki => $url)
        {
         $handle = fopen( $url, "r");
         $stat=fgets($handle);fclose($handle);
         $stat=substr($stat,strpos($stat,"articles=")+10);
         $stats[$wiki]=substr($stat,0,strpos($stat,"\""));
         print " | " . $wiki . " = " . $stats[$wiki] . "\n";
        }
 print " | updated = " . date("F j, Y") . "\n";
 print "}}\n";
 print "{{-stop-}}\n";
?>

See also

wtf

It doesnt seem to be working; .pt has over 3900 articles and it says 3700 in Main Page =S Mafagafo 20:07, 14 February 2007 (EST)

Main Page currently has brazillion pages as the size for pt: - which is huge. That's not counting any pages which have been eaten by mafagafos. --Carlb 21 April 2018 (DOA)