-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcinema.py
55 lines (50 loc) · 1.65 KB
/
cinema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from justgood import imjustgood
media = imjustgood("YOUR_APIKEY_HERE")
city = "garut" # example city name
data = media.cinema(city)
# Get cinema attributes
result = "Cinema 21"
result += "\n\nCity : {}\n".format(data["result"]["city"])
number = 0
for a in data["result"]["data"]:
number += 1
result += "\n{}. {}".format(number,a["cinema"])
print(result)
# Get cinema details attributes
number = 0
select_ = 1 # number of cinema
cinema = data["result"]["data"]
list_cinema = [o for o in cinema]
track = list_cinema[select_-1]
result = "{}".format(track["cinema"])
result += "\n{}".format(track["address"])
result += "\n\nNow playing :"
for a in track["nowPlaying"]:
number += 1
result += "\n{}. {}".format(number,a["movie"])
result += "\n\nStudio Image : {}".format(track["studioImage"])
print(result)
# Get movie details attributes
number = 0
select_one = 1 # number of cinema
select_two = 1 # number of movie
showtime = ""
cinema = data["result"]["data"]
list_cinema = [o for o in cinema]
track = list_cinema[select_one-1]
list_track = [y for y in track["nowPlaying"]]
movies = list_track[select_two-1]
for x in movies["showtime"]:
showtime += "{}, ".format(x)
result = "{}".format(movies["movie"])
result += "\n\nPrice : {}".format(movies["price"])
result += "\n\nShowtime : {}".format(showtime[:-2])
result += "\n\nGenre : {}".format(movies["genre"])
result += "\nDuration : {}".format(movies["duration"])
result += "\nDirector : {}".format(movies["director"])
result += "\nActor : {}".format(movies["actor"])
result += "\n\nSynopsis :\n{}".format(movies["synopsis"])
result += "\n\nPoster : {}".format(movies["poster"])
print(result)
# Get JSON results
print(data)