Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getImdb($fullpath){
- $imdb['rating']="";
- $imdb['storyline']="";
- $imdb['details']="";
- $imdb['ttcode']="";
- $doc = new DOMDocument();
- $doc->loadHTMLFile($fullpath);
- $finder = new DomXPath($doc);
- $ns_rating = $finder->query("//span[contains(@itemprop, 'ratingValue')]");
- $n_rating=$ns_rating->item(0);
- $imdb['rating']=$n_rating->nodeValue;
- $ns_storyLine= $finder->query("//div[contains(@id, 'titleStoryLine') and contains(@class,'article') ]");
- $n_storyLine=$ns_storyLine->item(0);
- $imdb['storyline']=getInnerHTML($n_storyLine);
- $ns_details= $finder->query("//div[contains(@id, 'titleDetails') and contains(@class,'article') ]");
- $n_details=$ns_details->item(0);
- $ns_ttcode= $finder->query("//meta[contains(@property, 'url')]");
- $n_ttcode=$ns_ttcode->item(0);
- $imdb['ttcode']=$n_ttcode->getAttribute("content");
- $imdb['ttcode']=substr($imdb['ttcode'],26,9);
- //remove all tag a href, except node value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement