use zUtil;

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

   print "=------------------ tribute Box office--------------------=\n";
   #print "html: $html\n";
   #exit;

   $count = 1;
   my $table = zUtil::getNthItemNew( $count, $html, "<table", "</table>" );
   #print "table: $table";

   $count=2;
   while( $count < 15 )
   {
       $row = zUtil::getNthItem( $count, $table, "<tr", "</tr>" );
#print "row: $row\n";

       $thisweek = zUtil::getNthItemNew( 1, $row, "<td", "</td>" );
       $lastweek = zUtil::getNthItemNew( 2, $row, "<td", "</td>" );
       $name = zUtil::getNthItemNew( 3, $row, "<td", "</td>" ); 
       $gross = zUtil::getNthItemNew( 6, $row, "<td", "</td>" ); 

       $name =~ s/\<.*?\>//gsi;
       $thisweek =~ s/\<.*?\>//gsi;
       $lastweek =~ s/\<.*?\>//gsi;
       $gross =~ s/\<.*?\>//gsi;
       # print "Movie: $name\n";
       # print "\tLink: $movieLink\n";
       # print "\trating: $rating\n";
       # print "\tstars: $stars\n";
       # print "\ttimes: $times\n\n";
 
       push @rValue,
       {
           'name' => $name,
           'thisweek' => $thisweek,
           'lastweek' => $lastweek,
           'gross' => $gross,
       };

       $count = $count + 1;
   }

   return @rValue;
}

return 1;

