LinHES Forums http://forums.linhes.org/ |
|
Mythvideo IMDB info http://forums.linhes.org/viewtopic.php?f=6&t=19264 |
Page 1 of 1 |
Author: | shrabok [ Tue Nov 25, 2008 4:19 pm ] |
Post subject: | Mythvideo IMDB info |
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, |
Author: | shrabok [ Sun Nov 30, 2008 4:29 pm ] |
Post subject: | |
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>", "/"); |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |