forked from sydlawrence/spotify-apps-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.html
More file actions
51 lines (41 loc) · 1.58 KB
/
Copy pathstorage.html
File metadata and controls
51 lines (41 loc) · 1.58 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
48
49
50
51
<!DOCTYPE html>
<html>
<head>
<style>
@import url('sp://import/css/eve.css');
@import url('sp://spotify-apps-tutorial/css/main.css');
</style>
<script src="sp://spotify-apps-tutorial/js/jquery.min.js"></script>
<script>
$(document).ready(function() {
/* Instantiate the global sp object; include models & views */
var sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");
var views = sp.require("sp://import/scripts/api/views");
var tracks = models.library.tracks;
for (i=0;i<tracks.length;i++) {
var name = tracks[i].data.name;
var uri = tracks[i].data.uri;
localStorage.setItem('name', name);
localStorage.setItem('uri', uri);
}
var storage = window['localStorage'];
console.log(storage.getItem('name'));
});
</script>
</head>
<body>
<div id="wrapper">
<ul class="breadcrumb">
<li><a href="sp://spotify-apps-tutorial/index.html">« Back to main page</a></li>
</ul>
<h1>Title of tutorial</h1>
<p class="description">Description of tutorial</p>
<h3>The Javascript</h3>
<h3>The HTML</h3>
<h3>The CSS</h3>
<h3>Live Example</h3>
<!-- Cool stuff goes here -->
</div><!-- /wrapper -->
</body>
</html>