Exemplo n.º 1
0
 def getMovie(self, code, profile=DEFAULT_PROFILE):
     retval = Movie(code=code)
     retval.getInfo(profile)
     return retval
Exemplo n.º 2
0
 def getMovie(self, code, profile = DEFAULT_PROFILE):
   retval = Movie(code = code)
   retval.getInfo(profile)
   return retval
Exemplo n.º 3
0
        retval = Movie(code=code)
        retval.getInfo(profile)
        return retval

    def getPerson(self, code, profile=DEFAULT_PROFILE):
        retval = Person(code=code)
        retval.getInfo(profile)
        return retval

    def reviewList(self, movie_code):
        d = json.loads(
            urllib.urlopen(
                "http://api.allocine.fr/rest/v3/reviewlist?partner=%s&format=json&code=%s"
                % (PARTNER_CODE, movie_code)).read())
        return [Review(**i) for i in d["feed"]["review"]]


if __name__ == "__main__":
    p = Allocine().search("robert de niro").persons[0]
    p.getFilmography()
    for m in p.filmography:
        print("%s played in %s" % (p, m.movie))
    m = Movie(code=32070)
    m.getInfo(profile="large")

    print("searching 'le parrain'")
    results = Allocine().search("the godfather")
    movie = results.movies[0]
    print("first result is %s" % movie)
    movie.getInfo()
    print("synopsis of %s : %s" % (movie, movie.synopsisShort))
Exemplo n.º 4
0
    d = json.loads(urllib2.urlopen(url).read())
    return self.SearchResults(d["feed"])

  def getMovie(self, code, profile = DEFAULT_PROFILE):
    retval = Movie(code = code)
    retval.getInfo(profile)
    return retval

  def getPerson(self, code, profile = DEFAULT_PROFILE):
    retval = Person(code = code)
    retval.getInfo(profile)
    return retval

  def reviewList(self, movie_code):
    d = json.loads(urllib.urlopen("http://api.allocine.fr/rest/v3/reviewlist?partner=%s&format=json&code=%s" % (PARTNER_CODE, movie_code)).read())
    return [Review(**i) for i in d["feed"]["review"]]

if __name__ == "__main__":
  p = Allocine().search("robert de niro").persons[0]
  p.getFilmography()
  for m in p.filmography:
    print("%s played in %s" % (p, m.movie))
  m = Movie(code=  32070)
  m.getInfo(profile = "large")

  print("searching 'le parrain'")
  results = Allocine().search("the godfather")
  movie = results.movies[0]
  print("first result is %s" % movie)
  movie.getInfo()
  print("synopsis of %s : %s" % (movie, movie.synopsisShort))