#use zUtil;
#use locale; 

sub thebearhandler
{
   $html = shift;
   my( @rValue ) = ();
   my( $count, $row, $col, $rank, $artist, $song, $newsong );
   my( $done );
   my( $item );

   print "=------------------ thebearhandler --------------------=\n";
   #print "html: $html\n";
   #exit;

   $count = 0;
   while( $count < 8 )
   {   
       if( $count == 0 ) 
       {
           $item = zUtil::getNthItemNew( 1, $html, "<div class=\"feature", "</div>" );
       }
       else
       {
           $item = zUtil::getNthItemNew( $count, $html, "<div class=\"sub-feature", "</div>" );
       }
       #print "item: $item\n\n";

       $rank=$count+1;
       $artist = zUtil::getNthItemNew( 1, $item, "<a", "</a>" );
       if( $artist =~ /<a.*?>(.*?)<\/a>/si )
       {
           $artist=$1;
       }
       if( $item =~ /<br\/>(.*?)<br\/>/si )
       {
           $song=$1;
           $song =~ s/\-+.*?$//s;
       }

       print "rank: $rank\n";
       print "artist: $artist\n";
       print "song: $song\n";

       push @rValue,
       {
           'rank' => $rank,
           'artist' => $artist,
           'song' => $song
       };

       $count=$count+1;
   }


   #   exit;

   return @rValue;
}

return 1;


