Created
October 4, 2019 05:14
-
-
Save jasongorman/46cd0b0c2ed4215e961118bd0fbf4ba2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from video import Video | |
class Pricer(object): | |
def price(self, imdbID): | |
response = requests.get("http://www.omdbapi.com/?i=" + imdbID + "&apikey=6487ec6299") | |
json = response.json() | |
title = json["Title"] | |
rating = float(json["imdbRating"]) | |
price = 3.95 | |
if rating > 7: | |
price += 1.0 | |
if rating < 4: | |
price -= 1.0 | |
return Video(imdbID, title, rating, price) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment