-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
35 lines (32 loc) · 845 Bytes
/
index.html
File metadata and controls
35 lines (32 loc) · 845 Bytes
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
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>TMAPI</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="../dist/web/tmapi-1.0.0.min.js"></script>
<script>
(function(tmapi) {
var sdk = tmapi('YOUR_KEY_HERE')
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.tmapi)
</script>
</body>
</html>