Dzahn has uploaded a new change for review. https://gerrit.wikimedia.org/r/208316
Change subject: fix sourceforce wiki updates ...................................................................... fix sourceforce wiki updates Bug:T97834 Change-Id: I50121d6fea04456da57bfa3364f23e7730fb6b10 --- M etc/wikistats/config.php M usr/lib/wikistats/update.php 2 files changed, 11 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/wikistats refs/changes/16/208316/1 diff --git a/etc/wikistats/config.php b/etc/wikistats/config.php index b596ba4..2ae1685 100644 --- a/etc/wikistats/config.php +++ b/etc/wikistats/config.php @@ -71,6 +71,9 @@ # list tables with URLs like wikiname.domain.org/api.php $tables_with_prefix_short=array('anarchopedias', 'wikisite', 'pardus', 'rodovid', 'opensuse','wikisite','scoutwiki', 'gamepedias','sourceforge'); +# list tables with URLs like wikiname.domain.org/wiki/api.php +$tables_with_prefix_wiki=array('sourceforge'); + # list tables with URLs like domain.org/wikiname/api.php $tables_with_suffix_short=array('editthis','lxde'); diff --git a/usr/lib/wikistats/update.php b/usr/lib/wikistats/update.php index 86a564d..d5cab18 100644 --- a/usr/lib/wikistats/update.php +++ b/usr/lib/wikistats/update.php @@ -184,6 +184,10 @@ $table="orain"; $domain="orain.org"; break; + case "wi": + $table="wikia"; + $domain="wikia.com"; + break; default: $table="unknown"; print "unknown table. exiting\n"; @@ -313,6 +317,9 @@ } elseif (in_array($table, $tables_with_prefix_short)) { $prefix=$row['prefix']; $url="http://".$row['prefix'].".${domain}/api.php${api_query_stat}"; + } elseif (in_array($table, $tables_with_prefix_wiki)) { + $prefix=$row['prefix']; + $url="http://".$row['prefix'].".${domain}/wiki/api.php${api_query_stat}"; } elseif (in_array($table, $tables_with_suffix_short)) { $prefix=$row['prefix']; $url="http://${domain}/".$row['prefix']."/api.php${api_query_stat}"; @@ -407,9 +414,6 @@ $good=0; } - #$views = explode("views=",$buffer); - #if (isset($views[1])) { $views = explode(";",$views[1]); $views = $views[0]; } - $edits = explode("edits=",$buffer); if (isset($edits[1])) { $edits = explode(";",$edits[1]); $edits = $edits[0]; } @@ -451,7 +455,7 @@ switch ($parsing_answer) { case 0: - print "---> OK - total: ${total} good: ${good} views: FIX? edits: ${edits} users: ${users} active users: ${ausers} admins: ${admins} images: ${images}\n"; + print "---> OK - total: ${total} good: ${good} edits: ${edits} users: ${users} active users: ${ausers} admins: ${admins} images: ${images}\n"; $updatequery="update ${table} set total=\"${total}\",good=\"${good}\",edits=\"${edits}\",users=\"${users}\",activeusers=\"${ausers}\",admins=\"${admins}\",images=\"${images}\",http=\"${statuscode}\",ts=NOW() where id=\"".$row['id']."\";"; if ($convert) { -- To view, visit https://gerrit.wikimedia.org/r/208316 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I50121d6fea04456da57bfa3364f23e7730fb6b10 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/wikistats Gerrit-Branch: master Gerrit-Owner: Dzahn <dz...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits