Ejemplo n.º 1
0
	def __init__(self,title = None, ID = None):
            """
                In order to initialise this object, either a title is required or imdbID is required.
                One can also specify a year while title is given. 
            """
            if (title is None) and (ID is None):
                print "Error: Either title or ID must be specified.\n No title or ID"
                del(self)
            elif (title and ID):
                print "Error: Both title and ID given."
                del(self)
            else:
                options = {}
                if title:
                    options['t'] = title
                else:
                    options['i'] = ID
                self.data = imdb.get_json(options)
Ejemplo n.º 2
0
 def search(self):
     if self.keyword == "":
         raise NoKeywordException
     options = {}
     options['s'] = self.keyword
     self.results = get_json(options)['Search']
Ejemplo n.º 3
0
 def _get_by_title(self,title):
     options = {}
     options['t'] = title
     self.data = imdb.get_json(options)
Ejemplo n.º 4
0
 def _get_by_id(self,ID):
     options = {}
     options['i'] = ID
     self.data = imdb.get_json(options)
Ejemplo n.º 5
0
def get_movie(title):
    options = {}
    options['t'] = title
    json = imdb.get_json(options)
    return json