IMDB AS3 Api (beta)
Posted in api, as3, flash on March 17th, 2008 by admin – 3 CommentsAs part of a school project about AS3 api’s i developed a small actionscript api that uses Itzchak Rehberg php classes to parse cache the imdb pages and extract the information from it(with a very cool caching mechanism). i just tweaked it a bit so it parses xml instead of html. there is a working draft copy here if you want to test it just type in a movie title and it will parse an xml wich gives you the all the associated imdb-id’s for it.
the as3 api now only concludes searching and fetching movie information.
its as easy as just to
var imdbSearch:SearchIMDB = new SearchIMDB(”scrubs”,20);
imdbSearch.addEventListener(Event.COMPLETE,serviceLoaded);
imdbSearch.load();
and for fetching a movie you can just do
movie = new Movie(<enter movie id here>);
movie.addEventListener(MovieEvent.LOADED,movieComplete);
movie.load();
Try not to put in a loop of fetching 500 movies at the same time because it will overload your internet connection. I did a couple of tests (try it out here) (srcview) i also did test to fetch movie information 1 at the time but it goes like 50% (avg) faster if you just request all at the same time ( just respect a golden rule .. “don’t overdo it”
)
you can download the source files here
you can download the php source files here
note that if you want to use the code that my server is only there for testing purpose and if you do want to setup you own project just copy the files to you php server and change the link. I can only keep my server online as long as it can handle traffic