gnump3d-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnump3d-users] Add time to /recent/ output ?


From: Jack Twilley
Subject: Re: [Gnump3d-users] Add time to /recent/ output ?
Date: Fri, 22 Jul 2005 12:33:41 -0700
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050410)

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";

reply via email to

[Prev in Thread] Current Thread [Next in Thread]