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
var sp = getSpotifyApi(1); | |
var models = sp.require("sp://import/scripts/api/models"); | |
var views = sp.require("sp://import/scripts/api/views"); | |
var playlistURL = 'spotify:user:magerleagues:playlist:5CZ3KO3EExplZOzHDMzgym'; | |
var playlist = models.Playlist.fromURI(playlistURL); | |
playlist.observe(models.EVENT.CHANGE, function() { | |
var mosaic = new views.Image(playlist.image); | |
mosaic.node.style.width = '300px'; |
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
/* 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 artists = ['Frank Sinatra', 'Drake', 'T-Pain', 'The Lonely Island', 'Avan Lava']; | |
var playlist = []; | |
var done = 0; |
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
sp = getSpotifyApi(1); | |
var models = sp.require('sp://import/scripts/api/models'); | |
tabs(); // See function definition below | |
/* When a user clicks a tab, the "arguments" property on the | |
* Application object changes, and the tabs() function fires */ | |
models.application.observe(models.EVENT.ARGUMENTSCHANGED, tabs); | |
function tabs() { |
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
{ | |
... | |
"DefaultTabs": [ | |
{ | |
"arguments": "index", | |
"title": { | |
"en": "Home" | |
} | |
}, | |
{ |
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
<div id="index"> | |
<!-- This content will show up in the "Home" tab --> | |
</div> | |
<div id="tabs"> | |
<!-- This content will show up in the "How to use tabs" tab --> | |
</div> |
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
/* 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"); | |
/* Create an array of tracks from the user's library */ | |
var tracks = models.library.tracks; | |
/* Create a temporary playlist and fill it with tracks | |
* from the previous query */ |
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
{ | |
"AppDescription": { | |
"en": "A tutorial app for Spotify Apps API" | |
}, | |
"AppIcon": { | |
"36x18": "tutorial.png" | |
}, | |
"AppName": { | |
"en": "Spotify Sandbox" | |
}, |
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
<style> | |
#play-me { | |
width:600px; | |
height:40px; | |
border:1px solid #333; | |
font:italic 2.5em Georgia, serif; | |
text-align:center;color:#000; | |
} | |
</style> |