Posted to tcl by mjanssen at Thu Oct 19 22:04:55 GMT 2006view raw

  1. package require http
  2. set data [set [http::geturl http://tvrage.com/quickschedule.php](body)]
  3.  
  4. set shows {}
  5.  
  6. set lines [split $data \n]
  7. foreach line $lines {
  8. regexp {\[(.*)?\](.*)\[.*\]} $line -> type value
  9. switch $type {
  10. DAY {set current_day $value}
  11. TIME {set show_time $value}
  12. SHOW {dict set shows $current_day $show_time $value}
  13. default {continue}
  14. }
  15. }
  16.  
  17. set dates [dict keys $shows]
  18.  
  19. puts $dates
  20.  
  21. set times [dict keys [dict get $shows [lindex $dates 0]]]