#116 IMDB doesn't fetch director and country

closed-fixed
nobody
engines (42)
5
2012-02-18
2012-01-10
Felix Sipma
No

Using latest version from CVS, the Imdb engine does not save director and country.

Discussion

  • dan

    dan - 2012-01-10

    the genre of the movie as well as the language are also not fetched anymore...

     
  • Jaime Leon

    Jaime Leon - 2012-01-30

    Hello. I am not a php programmer nor a videodb developer, but I can kinda follow the code. Looking at the imdb.com html output, I was able to figure out the small change needed for imdb.php to again pickup the director's name and the countries.

    If interested, here you can get the modified files:
    http://dl.dropbox.com/u/40885167/imdb.php

    Regards, Jaime

     
  • Jaime Leon

    Jaime Leon - 2012-01-30

    The changes that worked for me in imdb.php were:

    // Director
    preg_match('/<h4 class="inline">\s*Directors?:\s*<\/h4>(.*?)<\/div>/si', $resp['data'], $ary);
    preg_match_all('/<A .+?href="\/Name[?\/].+?"\s*?>(.+?)<\/A>/si', $ary[1], $ary, PREG_PATTERN_ORDER);

    // Countries
    preg_match('/Country:<\/h4>(.+?)<\/div>/si', $resp['data'], $ary);
    preg_match_all('/<A .+?HREF="\/Country\/.+?"\s*?>(.+?)<\/A>/si', $ary[1], $ary, PREG_PATTERN_ORDER);
    $data['country'] = trim(join(', ', $ary[1]));

    Regards, Jaime

     
  • J.B.

    J.B. - 2012-01-30

    It would be nice to have an official fix for this, this is really bothering to have to enter the data manually. I made the changes with jaime's fix, but then I get some strange ???? characters on the top of my screen. Anyway a fix would be very appreciated.

     
  • John Guy

    John Guy - 2012-01-31

    Taking the lead from Jaime I noticed the following will fix the language issue...

    // Languages
    preg_match_all('/<A .+?HREF="\/Language\/.+?"\s*?>(.+?)<\/A>/si', $resp['data'], $ary, PREG_PATTERN_ORDER);
    $data['language'] = trim(strtolower(join(', ', $ary[1])));

    Regards

     
  • John Guy

    John Guy - 2012-01-31

    This appears to get the genres as well...

    // Genres (as Array)
    preg_match('/Genres:<\/h4>(.+?)<\/div>/si', $resp['data'], $ary);
    preg_match_all('/<A .+?HREF="\/Genres?\/.+?"\s*?>(.+?)<\/A>/si', $ary[1], $ary, PREG_PATTERN_ORDER);
    foreach($ary[1] as $genre)
    {
    $data['genres'][] = trim($genre);
    }

    Regards

     
  • roland obermayer

    • status: open --> open-fixed
     
  • roland obermayer

    All these fixes and a few additional ones are in CVS

    Thanks guys
    sorry, that it took so long

    robelix

     
  • roland obermayer

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks