https://bugzilla.wikimedia.org/show_bug.cgi?id=59394

--- Comment #3 from Bugzilla Bug Importer (valhallasw) 
<wmf.bugconver...@gmail.com> ---
-------------------------------------------------------------------------------
From: Hoo man <h...@online.de>
Date: Sun, 24 Apr 2011 18:08:20
-------------------------------------------------------------------------------

Ok, fine, thanks for the language codes ![][1]  
Code (did id in PHP because I once again was to lazy for bash ![][2]):

    #!/bin/php
    <?php
    $langcodes = array('en', 'de', 'fr', 'pl', 'it', 'ja', 'es', 'ru', 'pt',
'nl', 'sv', 'zh', 'ca', 'no', 'uk', 'fi', 'vi', 'cs', 'hu', 'ko', 'ro', 'id',
'tr', 'da', 'ar', 'eo', 'sr', 'lt', 'sk', 'he', 'ms', 'bg', 'sl', 'hr', 'et',
'simple', 'th', 'eu', 'nn', 'el', 'az', 'la', 'tl', 'te', 'ka', 'sh',
'be_x_old', 'lv', 'jv', 'sq', 'bs', 'is', 'ta', 'an', 'oc', 'bn', 'ml', 'af',
'ur', 'zh_yue', 'ast', 'yo', 'wa', 'yi', 'uz', 'li', 'ia', 'szl');
    $file = '../public_html/dbq/dbq-137.txt';
    foreach($langcodes as $lang) {
        $query = 'SELECT /* SLOW_OK */ \'' . $lang . '\' as lang,
page_namespace, COUNT(*) as page_count, SUM(page_len) as namespace_size FROM
page WHERE page_namespace IN(0,1,2,3,4,5,6,7,10,11,100,101,12,13) AND
page_is_redirect = 0 GROUP BY page_namespace;';
        echo 'Executing "' . $query .'" on ' . $lang . "wiki_p\n";
        exec('mysql --host=' . $lang . 'wiki-p.rrdb.toolserver.org --database='
. $lang . 'wiki_p -e"' . $query . '" | cat >> ' . $file);
    }
    ?>


Result:  
http://toolserver.org/~hoo/dbq/dbq-137.txt (plain text)  
http://toolserver.org/~hoo/dbq/dbq-137.csv (Excel readable csv)

   [1]: https://jira.toolserver.org/images/icons/emoticons/smile.gif
   [2]: https://jira.toolserver.org/images/icons/emoticons/tongue.gif

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to