#!/usr/local/bin/ruby require 'cgi' cgi = CGI.new( "html4" ) puts "content-type: text/html\n\n" begin numVisitors = IO.read( '.visitors' ).to_i numVisitors = numVisitors + 1 File.open( '.visitors', 'w' ) { |theFile| theFile.write( numVisitors.to_s ) } if( cgi['dir'][0].nil? or not cgi['dir'][0][/^http:\/\/danceliquid.com\/music\//] ) theDir = '.' theBreadcrumb = '/music' else theDir = cgi['dir'][0].sub(/^http:\/\/danceliquid.com\/music/, '.') theBreadcrumb = "/music#{theDir.sub(/^\./, '')}" end $the_latest = [] def find_latest( inPath ) Dir.new( inPath ).each do |f| if( not f[/^\./] ) if( File.directory? f ) find_latest( "#{inPath}/#{f}" ) end if( f[/\.mp3$/] ) $the_latest.push( [File.new("#{inPath}/#{f}").ctime, "#{inPath}/#{f}"] ) end end end end puts "" puts "
" puts "" puts "#{f.last.sub(/^\.\//,'').gsub(/\//, ' - ')}" puts " - Uploaded on: "+f.first.strftime("%B %d %Y") if $the_first puts "
" $the_first = false end puts "