2011-06-07 13:26:45 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
source /mod/var/mongoose/lib/epg.class
|
2011-06-08 23:33:35 +00:00
|
|
|
source /mod/var/mongoose/lib/spinner.class
|
2011-06-07 13:26:45 +00:00
|
|
|
source /mod/var/mongoose/lib/altrow
|
|
|
|
|
2011-06-08 23:33:35 +00:00
|
|
|
[spinner new {
|
|
|
|
text "Loading EPG Data..."
|
|
|
|
size "1.2em"
|
|
|
|
style "margin: 1em;"
|
|
|
|
}] start
|
|
|
|
|
|
|
|
puts {
|
|
|
|
<div id=dialogue></div>
|
|
|
|
<script type=text/javascript>
|
|
|
|
$(document).ready(function() {
|
|
|
|
var $dialog = $('#dialogue').dialog({
|
|
|
|
title: "Programme Details",
|
|
|
|
modal: false,
|
|
|
|
autoOpen: false,
|
|
|
|
height: 500,
|
|
|
|
width: 700,
|
|
|
|
show: 'scale',
|
|
|
|
hide: 'fade',
|
|
|
|
draggable: false,
|
|
|
|
resizable: false,
|
|
|
|
buttons: { "Close":
|
|
|
|
function() {$(this).dialog('close');}},
|
|
|
|
close: function(e,u) { $('#dialogue').empty().html('<img src="/img/loading.gif" alt="loading">'); }
|
|
|
|
});
|
|
|
|
$('a.event').click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var url = $(this).attr('href');
|
|
|
|
$('#dialogue').load(url + '&bare=1');
|
|
|
|
$dialog.dialog('open');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
}
|
|
|
|
|
2011-06-07 13:26:45 +00:00
|
|
|
set start [clock milliseconds]
|
|
|
|
set records [epg fetch dump -time [clock seconds]]
|
|
|
|
set got [clock milliseconds]
|
|
|
|
|
|
|
|
puts {
|
|
|
|
<table class=borders>
|
|
|
|
<tr>
|
|
|
|
<th colspan=2>Channel</th>
|
|
|
|
<th>On Now</th>
|
|
|
|
<th>On Next</th>
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
|
|
|
|
proc rsort {v1 v2} {
|
|
|
|
set v1s [$v1 get channel_num]
|
|
|
|
set v2s [$v2 get channel_num]
|
|
|
|
|
|
|
|
if {$v1s == $v2s} { return 0 }
|
|
|
|
if {$v1s > $v2s } { return 1 }
|
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach record [lsort -command rsort $records] {
|
|
|
|
altrow
|
|
|
|
puts "<td>[$record get channel_num]</td>"
|
|
|
|
puts "<td>
|
|
|
|
<a href=/cgi-bin/epg_service.jim?service=[$record get service_id]>
|
|
|
|
[$record get channel_name]
|
|
|
|
</a></td>"
|
|
|
|
puts [$record cell]
|
|
|
|
puts [[$record next] cell]
|
|
|
|
puts "</tr>"
|
|
|
|
}
|
|
|
|
puts "</table>"
|
|
|
|
|
|
|
|
set end [clock milliseconds]
|
|
|
|
puts "<font class=footnote>
|
|
|
|
Retrieved now in: [expr [expr $got - $start] / 1000.0] seconds.<br>
|
|
|
|
All rendered in: [expr [expr $end - $start] / 1000.0] seconds.
|
|
|
|
</font>"
|
|
|
|
|
|
|
|
epg cleanup
|
|
|
|
|