Ejemplo n.º 1
0
      metascore -- 90
          genre -- Action, Adventure, Sci-Fi
    youtube_url -- https://www.youtube.com/watch?v=b_4nzm9ICuo
       response -- True
       language -- English, Russian
            dvd -- N/A
        country -- Australia, USA
        runtime -- 120 min
      imdbvotes -- 631,885
"""

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Creating an instance in one line using the shortcut `Movie.movie`
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

BLADE_RUNNER = Movie.movie('Blade Runner', '1982')  # `year` is optional

print(BLADE_RUNNER.title)
# | Blade Runner
print(BLADE_RUNNER.plot)
# | A blade runner must pursue and try to terminate four replicants who stole
# |  a ship in space and have returned to Earth to find their creator.
for key in BLADE_RUNNER.info:
    entry = '{0:>15} -- {1}'.format(key, BLADE_RUNNER.info[key])
    print(entry)
"""
      boxoffice -- N/A
           year -- 1982
     imdbrating -- 8.2
           plot -- A blade runner must pursue and try to terminate four 
                   replicants who stole a ship in space and have returned to 
#!/usr/bin//python

import search
import config
from media import Movie
from fresh_tomatoes import open_movies_page

search.YOUTUBE_API_KEY = config.YOUTUBE_API_KEY
search.OMDB_API_KEY = config.OMDB_API_KEY

INCEPTION = Movie.movie('Inception')
BLADE_RUNNER = Movie.movie('Blade Runner', '1982')
PRIMER = Movie.movie('Primer')
MAD_MAX = Movie.movie('Mad Max', '2015')
SNATCH = Movie.movie('Snatch')
BRICK = Movie.movie('Brick')

MOVIES = [INCEPTION, PRIMER, SNATCH, MAD_MAX, BLADE_RUNNER, BRICK]

open_movies_page(MOVIES)  # Generate HTML and open in browser