Skip Menu |

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

Report information
The Basics
Id: 83727
Status: open
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: g_ml2000-x [...] yahoo.de
Cc:
AdminCc:

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



Subject: directors() does not return name anymore
Obviously there has been some change on imdb.com again: IMDB::Film::directors now always returns an empty string for "name". ("id" is still available) Regards, Peter
From: g_ml2000-x [...] yahoo.de
the attached patch seems to fix it for the moment ... Regards, Peter
Subject: imdb_directors.patch
diff --git a/Film.pm b/Film.pm index 0fba862..b82d5bf 100644 --- a/Film.pm +++ b/Film.pm @@ -804,13 +804,14 @@ sub directors { } while ($tag = $parser->get_tag() ) { - my $text = $parser->get_text(); - - last if $text =~ /^writ(?:ing|ers)/i or $tag->[0] eq '/div'; - - if($tag->[0] eq 'a' && $tag->[1]{href} && $text !~ /(img|more)/i) { - my($id) = $tag->[1]{href} =~ /(\d+)/; - push @directors, {id => $id, name => $text}; + my $type=$tag->[0]; + last if $type eq '/div'; + if ($type eq 'a') { + my($id) = $tag->[1]{href} =~ /(\d+)/; + $tag= $parser->get_tag('span'); + if ($tag->[1]{itemprop} eq 'name') { + push @directors, {id => $id, name => $parser->get_text}; + } } }
Subject: Bug [rt.cpan.org #83727] for IMDB-Film: directors() does not return name anymore
Date: Wed, 12 Jun 2013 21:18:51 +0200
To: bug-IMDB-Film [...] rt.cpan.org
From: Uli Buck <uli.buck [...] rega-sense.ch>
I have adopted "imdb_directors.patch" with a small mofification plus made modifications to the "writers" and "cast" Subs to retrieve the corresponding information from imdb.com. The attached patch works okay for me. Note that my "writers" version also returns each write's "role". Regards, Uli

Message body is not shown because sender requested not to inline it.