1 | --- imdb.pl.orig 2007-06-10 15:45:06.000000000 -0400 |
---|
2 | +++ imdb.pl 2007-06-27 04:52:01.000000000 -0400 |
---|
3 | @@ -429,16 +433,16 @@ |
---|
4 | # possible matches are grouped in several catagories: |
---|
5 | # exact, partial, and approximate |
---|
6 | my $popular_results = parseBetween($response, "<b>Popular Titles</b>", |
---|
7 | - "</ol>"); |
---|
8 | + "</table>"); |
---|
9 | my $exact_matches = parseBetween($response, "<b>Titles (Exact Matches)</b>", |
---|
10 | - "</ol>"); |
---|
11 | + "</table>"); |
---|
12 | my $partial_matches = parseBetween($response, "<b>Titles (Partial Matches)</b>", |
---|
13 | - "</ol>"); |
---|
14 | -# my $approx_matches = parseBetween($response, "<b>Approximate Matches</b>", |
---|
15 | -# "</ol>"); |
---|
16 | + "</table>"); |
---|
17 | +# my $approx_matches = parseBetween($response, "<b>Titles (Approx Matches)</b>", |
---|
18 | +# "</table>"); |
---|
19 | # parse movie list from matches |
---|
20 | - my $beg = "<li>"; |
---|
21 | - my $end = "</li>"; |
---|
22 | + my $beg = "<tr>"; |
---|
23 | + my $end = "</tr>"; |
---|
24 | my $count = 0; |
---|
25 | my @movies; |
---|
26 | |
---|
27 | @@ -468,29 +472,18 @@ |
---|
28 | my $type = ""; |
---|
29 | my $movienum = ""; |
---|
30 | |
---|
31 | - my $link_end = "</a>"; |
---|
32 | - $fl_end = index($entry, $link_end); |
---|
33 | - $fl_end += length($link_end); |
---|
34 | - my $lhs = substr($entry, 0, $fl_end); |
---|
35 | - my $rhs = substr($entry, $fl_end); |
---|
36 | - |
---|
37 | - if ($lhs =~ m/<a href="\/title\/tt(\d+)\/.*\">(.+)<\/a>/i) { |
---|
38 | + if ($entry =~ m/<a href="\/title\/tt(\d+)\/.*\">(.+)<\/a> \((\d+)\)(?: \((.+)\))?/i) { |
---|
39 | $movienum = $1; |
---|
40 | $title = $2; |
---|
41 | + $year = $3; |
---|
42 | + $type = $4 if ($4); |
---|
43 | } else { |
---|
44 | if (defined $opt_d) { |
---|
45 | - print("Unrecognized entry format\n"); |
---|
46 | + print("Unrecognized entry format ($entry)\n"); |
---|
47 | } |
---|
48 | next; |
---|
49 | } |
---|
50 | |
---|
51 | - if ($rhs =~ m/\((\d+)\) \((.+)\)/) { |
---|
52 | - $year = $1; |
---|
53 | - $type = $2; |
---|
54 | - } elsif ($rhs =~ m/\((\d+)\)/) { |
---|
55 | - $year = $1; |
---|
56 | - } |
---|
57 | - |
---|
58 | my $skip = 0; |
---|
59 | |
---|
60 | # fix broken 'tv=no' option |
---|