Part of the EllisLab Network
   
 
CI IMDb Library
Posted: 03 February 2008 01:31 AM   [ Ignore ]  
Summer Student
Total Posts:  17
Joined  12-30-2007

I’m working on a site using CI right now that interfaces with IMDb.com to retrieve information about movies.  I have tweaked an excellent class called IMDBPHP to work as a CI library.  I thought I’d share it in case it would be useful for someone else.

CI IMDb Library

It uses Pear’s HTTP_Request package or another PHP class called browseremulator (included in the zip) to connect to IMDb.com and scrape information.  Pages can also be cached to speed up lookups.

Using the ID from IMDb.com, you can retrieve any info about a particular movie (run time, date, cast, directors, plot, etc).  You can also use the library to search IMDb for these IDs based on a movie title.

The code was fairly well documented, and there is an API reference available on the IMDBPHP site.

A quick note - IMDb changes their layout semi-regularly and this can sometimes cause pieces of the script to break.  You should keep an eye on the IMDBPHP home page as the maintainers are usually pretty good with posting updates to fix such issues.

Enjoy!

Profile
 
 
Posted: 03 February 2008 04:45 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  4785
Joined  07-14-2006

So it’s in fact a screenscraper specific for IMDb. Maybe it could be extended to use for other sites who don’t offer rss or apis.

Thanks for the share.

Profile
 
 
Posted: 24 March 2008 03:24 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  21
Joined  11-17-2007
xwero - 03 February 2008 09:45 AM

So it’s in fact a screenscraper specific for IMDb.

Thanks captain obvious, he stated that in his own post.

There was only one problem with this library for me, repeated searches don’t clear the results after each request.

My lines are probably slightly off compared to the original but at around line 1437 replace:

function results($url ""

with

function results($url ""{
        
unset($this->resu); 

I’m working on converting it to use cUrl right now as the browser emulator is painfully slow, and i can’t stand using pear (if i wanted a behemoth, i could just use zend framework instead wink )

Profile
 
 
Posted: 24 March 2008 06:12 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  37
Joined  01-25-2008

Thanks for sharing. Good documentation too. cheese

Profile
 
 
Posted: 25 March 2008 03:30 AM   [ Ignore ]   [ # 4 ]  
Sr. Research Associate
RankRankRankRankRank
Total Posts:  4785
Joined  07-14-2006

@pwninja : nice piece of using only the part you want to react on and bring someone down. It was the observation that is the stepping stone for the actual request how the contribution could be extended.

If you only think about making others bad (pear,zend framework) you’re on the wrong forum.

Profile
 
 
Posted: 25 March 2008 12:58 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Avatar
Total Posts:  21
Joined  11-17-2007
xwero - 25 March 2008 07:30 AM

@pwninja : nice piece of using only the part you want to react on and bring someone down. It was the observation that is the stepping stone for the actual request how the contribution could be extended.

If you only think about making others bad (pear,zend framework) you’re on the wrong forum.

My apologies, I thought you were just stating the obvious, I see now you were just priming the next sentence.

I’ve updated this library to use the latest version of the IMDBPHP class, I’ll post it when I get home this evening if i have a chance. I’m having trouble so far making cUrl behave exactly like the PEAR class, so that won’t be making an appearance yet.

Profile
 
 
Posted: 25 May 2008 05:13 PM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  179
Joined  12-18-2007

Hello,

Anybody can reupload? Is not avaible on the initial blog.

Thank you,
—Isern Palaus

Profile
 
 
Posted: 27 May 2008 11:12 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  593
Joined  02-04-2008

Wouldn’t this be against the imdb terms of use?

Profile
 
 
Posted: 03 June 2008 07:10 AM   [ Ignore ]   [ # 8 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  179
Joined  12-18-2007

I think no. :S

Regards,
—Isern Palaus

Profile
 
 
Posted: 03 June 2008 10:55 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  593
Joined  02-04-2008

Did you check their terms? It’s right up top.

License and Site Access
IMDb grants you a limited license to access and make personal use of this site and not to download (other than page caching) or modify it, or any portion of it, except with express written consent of IMDb. This site or any portion of this site may not be reproduced, duplicated, copied, sold, resold, visited, or otherwise exploited for any commercial purpose without express written consent of IMDb. This license does not include any resale or commercial use of this site or its contents or any derivative use of this site or its contents.

I only am aware of this because I worked at a company once that had to license the content from IMDB. They make significant amounts of money from distributing their content and don’t give it away for free.

Profile
 
 
Posted: 24 August 2011 12:11 PM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  26056
Joined  05-14-2004

Hey all,

I am posting on behalf of mikemike - is there any chance of a re-upload of this?

Thank you!

 Signature 
Profile
MSG