Skip Menu |

This queue is for tickets about the IMDB-Film CPAN distribution.

Report information
The Basics
Id: 84731
Status: new
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: eric [...] gauthiers.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: full_plot() method incorrect with embedded links
Date: Thu, 18 Apr 2013 23:42:52 -0700
To: bug-IMDB-Film [...] rt.cpan.org
From: Eric Gauthier <eric [...] gauthiers.net>
I don't know if IMDB has updated things or not, but they have embedded links in their plot summary. The full_plot() method uses the get_trimmed_text() method from the TokeParser, which stops parsing when it sees a new tag (e.g. an <a> embedded in the <p> of the plot. the solution is to use the the get_text() method with an end tag specified, like this below: You may still need to do some manually trimming of newline and whitespace. You can see this with IMDB id tt1758830 (This is 40). while(my $tag = $parser->get_tag('p')) { if(defined $tag->[1]{class} && $tag->[1]{class} =~ /plotpar/i) { $text = $parser->get_text('/p'); # $text = $parser->get_trimmed_text(); last; } } Here is the output of full_plot() with current get_trimmed_text() method: Pete ( And here is the output of full_plot() using the above code snippet: Pete (Paul Rudd) and Debbie (Leslie Mann) are turning 40. But instead of celebrating, they're mired in a mid-life crisis with unruly kids, debt and unhappiness mounding. Pete's record label is failing and Debbie is unable to come to terms with her aging body. As Pete's 40th birthday party arrives, Pete and Debbie are going to have to rely on family, friends, employees, fitness trainers, aging rockers and ultimately each other to come to terms with life at age 40. Written by napierslogs Here is the associated HTML from imdb.com <p class=​"plotpar">​<p class="plotpar"> Pete (<a href="/name/nm0748620/">Paul Rudd</a>) and Debbie (<a href="/name/nm0005182/">Leslie Mann</a>) are turning 40. But instead of celebrating, they're mired in a mid-life crisis with unruly kids, debt and unhappiness mounding. Pete's record label is failing and Debbie is unable to come to terms with her aging body. As Pete's 40th birthday party arrives, Pete and Debbie are going to have to rely on family, friends, employees, fitness trainers, aging rockers and ultimately each other to come to terms with life at age 40. <i> Written by <a href="/search/title?plot_author=napierslogs&amp;view=simple&amp;sort=alpha">napierslogs</a> </i> </p>