#!/mod/bin/jimsh package require cgi source /mod/var/mongoose/lib/setup require epg.class spinner.class altrow epg_search totop [spinner new { text "Loading Now/Next Information..." size "1.2em" style "margin: 1em;" }] start require epg_popup set start [clock milliseconds] set records [epg fetch dump -time [clock seconds]] set got [clock milliseconds] set favlist [epg favlist] puts { } 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 $records { $record get_channel_info } foreach record [lsort -command rsort $records] { if {$favlist != "" && [$record get service_id] ni $favlist} { continue } set num [$record get channel_num] if {$num == 0 || $num >= 800} { continue } altrow puts "" puts "" catch { puts [$record cell] puts [[$record next] cell] } puts "" } puts "
Channel On Now On Next
$num[$record channel_icon 50] [$record get channel_name]
" puts " Visit settings to change EPG options.
" set end [clock milliseconds] puts " Retrieved in: [expr [expr $got - $start] / 1000.0] seconds. Rendered in: [expr [expr $end - $start] / 1000.0] seconds. " epg cleanup