CI IMDb Library |
[eluser]nevercraft[/eluser]
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!
[eluser]xwero[/eluser]
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.
[eluser]pwninja[/eluser]
[quote author="xwero" date="1202049933"]So it's in fact a screenscraper specific for IMDb.[/quote] 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: Code: function results($url = "") { Code: function results($url = "") { 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 )
[eluser]Ebot Ndip-Agbor[/eluser]
Thanks for sharing. Good documentation too. :cheese:
[eluser]xwero[/eluser]
@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.
[eluser]pwninja[/eluser]
[quote author="xwero" date="1206448254"]@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.[/quote] 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.
[eluser]Isern Palaus[/eluser]
Hello, Anybody can reupload? Is not avaible on the initial blog. Thank you, -- Isern Palaus
[eluser]louis w[/eluser]
Did you check their terms? It's right up top. Quote:License and Site Access 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. |
Welcome Guest, Not a member yet? Register Sign In |