Posted to tcl by schelte at Thu Jun 02 15:26:02 GMT 2011view raw

  1. foreach oscar [split $imdbdata \n] {
  2. if {[regexp {<title>(.*)\((.*)\) - IMDb</title>} $oscar tp0 tp1 tp2 tp3]} {
  3. set fas1 "$tp1"
  4. set fas12 "$tp2"
  5. }
  6. if {[regexp {&nbsp;&nbsp;(.*)min&nbsp;} $oscar tpp0 tpp1 tpp2 tpp3]} {
  7. set fas2 "$tpp1 $tpp2"
  8. }
  9. if {[regexp {class="rating-rating">(.*)<span>/(.*)</span></span>} $oscar tppp0 tppp1 tppp2]} {
  10. set fas3 "$tppp1"
  11. set fas33 "$tppp2"
  12. }
  13. foreach {full tpppp} [regexp -all -inline {href="/genre/.*?">(.*?)</a>} $oscar] {lappend fas4 $tpppp}
  14. }
  15.  
  16. set fas2 [string trimright $fas2]
  17.  
  18. putlog "$fas1$fas12 $fas2\min [join $fas4 " | "] $fas3/$fas33"