use zUtil;


sub cinema
{
   $html = shift;
   my( @rValue ) = ();
   my( $count, $row, $movie, $rating, $times );
   my( $done, $initial );

   print "=------------------ cinema --------------------=\n";
#   print "html: $html\n";

   $count= 6;
   while( $count < 74 )
   {
       $row = zUtil::getNthItem( $count, $html, "<td", "</td>" );

       if( $row =~ /.*?class=heading/gsi )
       {
           $movie = zUtil::getNthItemNew( 1, $row, "<span", "</span>" );
           if( $movie =~ /<a.*?>(.*?)<\/a>/gsi )
           {
               $movie = $1;
               # convert from the horrible all caps ...
               $movie =~ s/^\s*//gsi;
               $movie =~ s/\s*$//gsi;
               $movie =~ s/(\w+)/\u\L$1/g;
               $movie =~ s/, The$//gsi;
           }
           $rating = zUtil::getNthItemNew( 2, $row, "<span", "</span>" );
           if( $rating =~ /<span.*?>(.*?)<\/span>/gsi )
           {
               $rating = $1;
               $rating =~ s/&nbsp;//gsi;
               $rating =~ s/^\s*//gsi;
               $rating =~ s/\s*$//gsi;
           }
           # $times = zUtil::getNthItem( 4, $row, "<td", "</td>" ); 

           print "found movie: $movie, with rating: $rating\n";
 
           push @rValue,
           {
	           'movie'  => $movie,
              'rating' => $rating,
	           'times' => $times,
           };
       }

       $count = $count + 1;
   }

   # exit;
   return @rValue;
}

return 1;

