[SimBot-commits] CVS: simbot/plugins google.pl,1.19,1.20
Status: Abandoned
Brought to you by:
kstange
|
From: Pete P. <fou...@us...> - 2005-05-13 02:03:40
|
Update of /cvsroot/simbot/simbot/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28003/plugins Modified Files: google.pl Log Message: We now understand half stars. Index: google.pl =================================================================== RCS file: /cvsroot/simbot/simbot/plugins/google.pl,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -p -r1.19 -r1.20 --- google.pl 12 May 2005 12:32:18 -0000 1.19 +++ google.pl 13 May 2005 02:03:22 -0000 1.20 @@ -83,14 +83,19 @@ sub google_find { # Movies! # Let's count the stars... - my @star_list = $response->content =~ m{<nobr><img src="/images/showtimes-star-(on|off)\.gif" border=0><img src="/images/showtimes-star-(on|off)\.gif" border=0><img src="/images/showtimes-star-(on|off)\.gif" border=0><img src="/images/showtimes-star-(on|off)\.gif" border=0><img src="/images/showtimes-star-(on|off)\.gif" border=0></nobr>}; + my @star_list = $response->content =~ m{<nobr><img src="/images/showtimes-star-(on|off|half)\.gif" border=0><img src="/images/showtimes-star-(on|off|half)\.gif" border=0><img src="/images/showtimes-star-(on|off|half)\.gif" border=0><img src="/images/showtimes-star-(on|off|half)\.gif" border=0><img src="/images/showtimes-star-(on|off|half)\.gif" border=0></nobr>}; my $stars; - if ($star_list[4] eq 'on') { $stars = 5; } - elsif($star_list[3] eq 'on') { $stars = 4; } - elsif($star_list[2] eq 'on') { $stars = 3; } - elsif($star_list[1] eq 'on') { $stars = 2; } - elsif($star_list[0] eq 'on') { $stars = 1; } - else { $stars = 0; } + if ($star_list[4] eq 'on') { $stars = 5; } + elsif($star_list[4] eq 'half') { $stars = 4.5; } + elsif($star_list[3] eq 'on') { $stars = 4; } + elsif($star_list[3] eq 'half') { $stars = 3.5; } + elsif($star_list[2] eq 'on') { $stars = 3; } + elsif($star_list[2] eq 'half') { $stars = 2.5; } + elsif($star_list[1] eq 'on') { $stars = 2; } + elsif($star_list[1] eq 'half') { $stars = 1.5; } + elsif($star_list[0] eq 'on') { $stars = 1; } + elsif($star_list[0] eq 'half') { $stars = 0.5; } + else { $stars = 0; } my ($url, $title) = $response->content =~ m|<td valign=top><a href="(/reviews?\S+)">(.*?)</a>|; $url = 'http://www.google.com' . $url; |