On Sep 28, Iuhas Daniel <[EMAIL PROTECTED]> wrote:
> I have an SQL installation of IMDBpy and i don't know how to convert the
> movie_id to a string representing the imdbID of the movie as used by the
> IMDb web server
You can use the get_imdbID(movie) or get_imdbMovieID(movieID)
methods of the IMDb instance you use to access the SQL database.
E.g.:
>>> from imdb import IMDb
>>> i = IMDb('sql', uri='mysql://user:[EMAIL PROTECTED]/imdbDB')
>>> # the first movie of a search.
>>> goonies = i.search_movie('the goonies')[0]
>>> goonies.movieID
165976
>>> i.get_imdbID(goonies)
'0089218'
>>> i.get_imdbMovieID(goonies.movieID)
'0089218'
Obviously it will connect to the IMDb server, so it would be
a _very bad idea_ to use this system to retrieve the movieIDs
of every movie in the database. :-)
The get_imdbID(person) can also be used with Person objects, or you
can use the get_imdbMovieID(personID) method.
> and i wanna do that with PHP.
I don't know; I suppose you can always write a simple python script
as above (taking the movieID as input) and then read its output (write
the imdbID to the stdout), using calls like 'system'.
HTH,
--
Davide Alberani <[EMAIL PROTECTED]> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Imdbpy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/imdbpy-devel