-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (44 loc) · 1.15 KB
/
index.html
File metadata and controls
47 lines (44 loc) · 1.15 KB
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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title><%= htmlWebpackPlugin.options.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
display: flex;
align-content: center;
}
p {
margin: auto;
padding: 10px;
border: 1px solid grey;
border-radius: 5px;
text-align: center;
}
</style>
</head>
<body>
<p>Logging to console...</p>
<script>
(function (ticketmaster) {
var sdk = ticketmaster('YOUR_API_KEY');
function logNextPage (page) {
console.group('page: ' + page.page.number);
page.items.map(console.log);
console.groupEnd();
return page.getNext()
}
if (sdk) {
sdk.discovery.v1.attraction.all({page: 4, size: 5, city: 'London'})
.then(logNextPage)
.then(logNextPage)
.then(logNextPage)
.catch(function (e) {
console.log(e)
})
}
})(window.ticketmaster)
</script>
</body>
</html>