HALog Mobile Edition
Short Listing\n";
} else {
$url=$url_short;
print "Full Listing\n";
}
print "  Halog\n";
$lines=file($url);
$daynamepat="/
(Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)<\/h2>/i";
/* Relies on 15 char fixed-width 'name' field in halog */
$entrypat="/^
(\d*) +.*? +([\d:]+?) +(.{15}) +(.*)<\/a>/i";
$NENTRIES=25; // Display 25 entries
$nshown=0;
$prefix="http://www.jlab.org/~adaq/halog/html/";
include("http://hallcweb.jlab.org/palm/halldata.txt");
foreach($lines as $line_num => $line) {
if(preg_match($daynamepat,$line,$regs)) {
print "$regs[1]
\n";
} else {
if(preg_match($entrypat,$line,$regs)) {
print "$regs[3] $regs[2] $regs[5]
\n";
$nshown++;
}
}
if($nshown>=$NENTRIES) break;
}
?>