#!/mod/bin/jimsh package require cgi source /mod/var/mongoose/lib/epg.class source /mod/var/mongoose/lib/spinner.class source /mod/var/mongoose/lib/altrow source /mod/var/mongoose/lib/cat puts "Content-Type: text/html" puts "" source /mod/var/mongoose/html/lib/header.jim puts "" source /mod/var/mongoose/lib/epg_popup cgi_input #cgi_dump #set _cgi [dict create term "doctor who"] #set env(REQUEST_URI) "test" set term "" catch { set term [dict get $_cgi term] } set cmd "search" if {[dict exists $_cgi full]} { set cmd "searchall" } set ct 0 catch { set ct [dict get $_cgi ct] } set crid "" catch { set crid [dict get $_cgi crid] } set scrid "" catch { set scrid [dict get $_cgi scrid] } puts "
" [spinner new { text "Loading EPG Data..." size "1.2em" style "margin: 1em;" }] start if {$ct > 0 } { set records [epg fetch dump -type $ct] } elseif {$crid ne ""} { set records [epg fetch dump -crid $crid] } elseif {$scrid ne ""} { set records [epg fetch dump -scrid $scrid] } elseif {$term ne ""} { set records [epg fetch $cmd -extra $term] } set favlist [epg favlist] puts {Date | Channel | Programme | Synopsis |
[clock format [$record get start] -format "%a %d %b %Y"] [clock format [$record get start] -format "%H:%M %Z"] | "
puts "[$record get channel_num] | " puts "[$record channel_icon 50] | " puts "[$record get channel_name] | " puts [$record cell] puts "[$record get text] | [$record get warning] | " puts "" flush stdout } puts "
---|