Informations from imdb with file_get_content and explode problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cedry2k
    replied
    Actually I was thinking to try the imdbapi, because I think it will be faster than the explode...

    Leave a comment:


  • analyzer
    replied
    Or maybe he's trying to make something different..

    Leave a comment:


  • kevk3v
    replied
    Maybe he isn't good with regular expressions or because explode is faster :P

    Leave a comment:


  • razzbee
    replied
    Why dont you use preg_split instead of explode ?

    Leave a comment:


  • something else
    replied
    Originally posted by cedry2k View Post
    What is the problem?
    First Problem:
    PHP Code:
    $poster explode('<img height="317" width="214" src="'$url ); 
    It should be alt=" not src="

    Second problem:
    You need to strip all newline symbols \n \r and white-space etc as other wise you will not get a match for your exploding

    Leave a comment:


  • kevk3v
    replied
    Why dont you use the api Link it will be faster
    like this http://imdbapi.org/?q=finding%20nemo you will get a json response
    Last edited by kevk3v; 14.05.13, 23:09.

    Leave a comment:


  • Informations from imdb with file_get_content and explode problem

    Hi, I'm trying to make an plugin that grab the movie info from imdb and displays them on a page.
    The problem is that I can't get the poster.
    This is my code:

    PHP Code:
    $url file_get_contents("http://www.imdb.com/title/tt1980209/");
    $poster explode('<img height="317" width="214" src="'$url );
    $poster explode('" itemprop="image" />'$poster[1]);

    $picture '<img height="170" width="150" src="'.$poster[0].'" />';
    echo 
    $picture
    In the "View page source" I see only this:
    <img height="170" width="150" />

    The imdb page source html for poster is this:
    Code:
    <img height="317"
    width="214"
    alt="Pain & Gain (2013) Poster"
    title="Pain & Gain (2013) Poster"
    src="http://ia.media-imdb.com/images/M/MV5BMTU0NDE5NTU0OV5BMl5BanBnXkFtZTcwMzI1OTMzOQ@@._V1_SY317_CR0,0,214,317_.jpg"
    itemprop="image" />
    What is the problem?
Working...
X