Posted to tcl by mjanssen at Thu Oct 19 22:04:55 GMT 2006view raw
- package require http
- set data [set [http::geturl http://tvrage.com/quickschedule.php](body)]
- set shows {}
- set lines [split $data \n]
- foreach line $lines {
- regexp {\[(.*)?\](.*)\[.*\]} $line -> type value
- switch $type {
- DAY {set current_day $value}
- TIME {set show_time $value}
- SHOW {dict set shows $current_day $show_time $value}
- default {continue}
- }
- }
- set dates [dict keys $shows]
- puts $dates
- set times [dict keys [dict get $shows [lindex $dates 0]]]