-
Notifications
You must be signed in to change notification settings - Fork 0
/
songinfo.php
30 lines (28 loc) · 821 Bytes
/
songinfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/php
<?php
include 'lib/autoload.php';
$out = new ezcConsoleOutput();
try {
$song = new FOFSong( getcwd() );
} catch( Exception $e ) {
echo "Exception: " . $e->getMessage() . "\n";
exit( 1 );
}
$out->outputLine( $song->name . " by " . $song->artist );
$out->outputLine( "Played count: {$song->count}" );
$out->outputLine();
$out->outputLine( "Scores: " );
foreach ( array( 'easy', 'medium', 'hard', 'amazing' ) as $difficulty )
{
if ( isset( $song->scores->$difficulty ) )
{
$scores = $song->scores->$difficulty;
$out->outputLine( "* " . $scores->difficultyName );
foreach( $scores->scores as $idx => $score )
{
$rank = $idx+1;
$out->outputLine( "{$rank}. {$score->player}: {$score->score} ({$score->stars}*, {$score->percentage}% - {$score->notesOk}/{$score->notesTotal})" );
}
}
}
?>