Last active
August 29, 2015 14:01
-
-
Save jsutterfield/e6ff210d3cbd792dc83f to your computer and use it in GitHub Desktop.
Revisions
-
jsutterfield revised this gist
May 14, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ class reportTotalVideosOnWikia { const LOG_FILE = '/tmp/reportTotalVideosOnWikiaAll.csv'; public static function run ( $db, $test = false, $verbose = false, $params ) { -
jsutterfield renamed this gist
May 14, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jsutterfield renamed this gist
May 8, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jsutterfield created this gist
May 8, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ <?php class reportTotalVideosOnWikia { const LOG_FILE = '/tmp/reportTotalVideosOnWikia.csv'; public static function run ( $db, $test = false, $verbose = false, $params ) { $dbname = $params['dbname']; // Get a count of all videos grouped by provider on this wiki $sql = "select provider, count(*) as total_videos from video_info where removed = 0 group by provider;"; if ( $verbose ) { echo "Running on $dbname\n"; } $res = $db->query( $sql ); while ( $row = $db->fetchRow( $res ) ) { // Construct csv line in the form of "provider,video_count,db_name" $provider = $row['provider']; $total_videos = $row['total_videos']; $msg = "$provider,$total_videos,$dbname\n"; if ( !$test ) { file_put_contents( self::LOG_FILE, $msg, FILE_APPEND ); } } } }