Steve Kemp wrote:
On Thu, Jul 21, 2005 at 04:34:14PM -0700, Jack Twilley wrote:

I like the listing of recent songs played, but it'd be cool if the time when they were played were added. How difficult would that be?


  Fairly simple - the "gnump3d-top" program just needs to parse the
 information from the logfile in addition to the song name.

  If you want to play with it I'd accept any changes that did that.

I've hacked it to handle the time, but the table looks kinda funky. The whole table bit needs to be tweaked in gnump3d for "most recent" and probably others, but I've got the time data included so that when the table stuff does eventually work, it'll have all three columns.


Steve
--

Jack.
375c375
<       if ( $line =~ /([^ ]+) (.*)\"GET ([^\"]+)\"/ )
---
>       if ( $line =~ /([^ ]+) (.*) \[([^\]]+)\] \"GET ([^\"]+)\"/ )
378c378,381
<           my $entry = $3;
---
>           my $time  = $3;
>           my $entry = $4;
> 
>           $DEBUG && print "IP is $ip, Time is $time, Entry is $entry\n";
398c401
<                   push @last, "$ip|$entry";
---
>                   push @last, "$ip|$time|$entry";
410c413
<       print "Host\t\tSong\n";
---
>       print "Host\t\tTime\t\tSong\n";
414c417
<       print "<tr><td><b>Host</b></td><td><b>Song</b></td></tr>\n";
---
>       print 
> "<tr><td><b>Host</b></td><td><b>Time</b></td><td><b>Song</b></td></tr>\n";
436,437c439,440
<       my ( $host, $song );
<       if ($last[ $i ] =~ /(.*)\|(.*)/ )
---
>       my ( $host, $time, $song );
>       if ($last[ $i ] =~ /([^|]+)\|([^|]+)\|([^|]+)/ )
440c443,444
<           $song = $2;
---
>           $time = $2;
>           $song = $3;
445c449
<           print $host . "\t\t" . $song . "\n";        
---
>           print $host . "\t\t" . $time . "\t\t" . $song . "\n";       
449,450c453,454
<           print "<tr><td>$host</td><td><a href=\"" . $song . $alwaysStream .
<               "\">" . $song. "</a></td></tr>\n";
---
>           print "<tr><td>$host</td><td>$time</td><td><a href=\"" . 
>               $song . $alwaysStream .  "\">" . $song. "</a></td></tr>\n";
_______________________________________________
Gnump3d-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnump3d-users

Reply via email to