View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 2 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
 Post subject: Mythvideo IMDB info
PostPosted: Tue Nov 25, 2008 4:19 pm 
Offline
Joined: Mon Feb 26, 2007 10:15 am
Posts: 26
Hi,

I was playing around with my mythvideo setup and when I grabbed IMDB info it would never contain Plot or IMDB rating. I looked through imdb.pl and found that

Quote:
# parse plot
my $plot = parseBetween($response, ">Plot Outline:</h5> ", "</div>");
if (!$plot) {
$plot = parseBetween($response, ">Plot Summary:</h5> ", "</div>");
}
if (!$plot) {
$plot = parseBetween($response, ">Plot:</h5>", "</div>");
}


if ($plot) {
# replace name links in plot (example 0388795)
$plot =~ s/$name_link_pat/$1/g;

# replace title links
my $title_link_pat = qr!<a href="/title/[^"]*">([^<]*)</a>!m;
$plot =~ s/$title_link_pat/$1/g;

# plot ends at first remaining link
my $plot_end = index($plot, "<a ");
if ($plot_end != -1) {
$plot = substr($plot, 0, $plot_end);
}
$plot = trim($plot);


The addition in RED was missing (note I'm still on R5F27) and also the other entries (Plot Summary, and Plot Outline) have a space before the quotation mark ( ">Plot Summary:</h5> " should be ">Plot Summary:</h5>" ) the space after the > would not work if Plot Summary was the place to get the info, I noticed when I changed Plot Summary to Plot it would pull the information and the space would cause it to break.

But now my question is about IMDB rating. IMDB user rating is after the stars which I think is why I am not able to get the user rating for the movies.

Does anyone know how to correct that code?

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 30, 2008 4:29 pm 
Offline
Joined: Mon Feb 26, 2007 10:15 am
Posts: 26
Found the issue, the script was written like this:
Quote:
# parse user rating
my $userrating = parseBetween($response, ">User Rating:</b>", "</b>");
$userrating = parseBetween($userrating, "<b>", "/");


But found that the </b> should have been </h5> after User Rating:
So it would look something like this.

Quote:
# parse user rating
my $userrating = parseBetween($response, ">User Rating:</h5>", "</b>");
$userrating = parseBetween($userrating, "<b>", "/");


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu