Ticket #3670: patch_newlist.txt

File patch_newlist.txt, 2.1 KB (added by aprotim@…, 18 years ago)
Line 
1--- imdb.pl.orig 2007-06-10 15:45:06.000000000 -0400
2+++ imdb.pl 2007-06-27 03:19:17.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+ "</table>");
15 # my $approx_matches = parseBetween($response, "<b>Approximate Matches</b>",
16-# "</ol>");
17+# "</table>");
18 # parse movie list from matches
19- my $beg = "<li>";
20- my $end = "</li>";
21+ my $beg = "<tr>";
22+ my $end = "</tr>";
23 my $count = 0;
24 my @movies;
25
26@@ -468,29 +472,18 @@
27 my $type = "";
28 my $movienum = "";
29
30- my $link_end = "</a>";
31- $fl_end = index($entry, $link_end);
32- $fl_end += length($link_end);
33- my $lhs = substr($entry, 0, $fl_end);
34- my $rhs = substr($entry, $fl_end);
35-
36- if ($lhs =~ m/<a href="\/title\/tt(\d+)\/.*\">(.+)<\/a>/i) {
37+ if ($entry =~ m/<a href="\/title\/tt(\d+)\/.*\">(.+)<\/a> \((\d+)\)(?: \((.+)\))?/i) {
38 $movienum = $1;
39 $title = $2;
40+ $year = $3;
41+ $type = $4 if ($4);
42 } else {
43 if (defined $opt_d) {
44- print("Unrecognized entry format\n");
45+ print("Unrecognized entry format ($entry)\n");
46 }
47 next;
48 }
49
50- if ($rhs =~ m/\((\d+)\) \((.+)\)/) {
51- $year = $1;
52- $type = $2;
53- } elsif ($rhs =~ m/\((\d+)\)/) {
54- $year = $1;
55- }
56-
57 my $skip = 0;
58
59 # fix broken 'tv=no' option