File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ <!doctype html>
2+
3+ < html lang ="en ">
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < title > Exportify</ title >
7+ < link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css ">
8+
9+ < style >
10+ .starter-template {
11+ padding : 40px 15px ;
12+ text-align : center;
13+ }
14+ </ style >
15+
16+ < script src ="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js "> </ script >
17+ < script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js "> </ script >
18+ </ head >
19+
20+ < body >
21+ < div class ="container ">
22+ < div class ="starter-template ">
23+ < h1 > Exportify</ h1 >
24+ < p class ="lead "> Proof of concept app for exporting Spotify playlists.</ p >
25+
26+ < button id ="loginButton " type ="button " class ="btn btn-default btn-lg ">
27+ < span class ="glyphicon glyphicon-star " aria-hidden ="true "> </ span > Login
28+ </ button >
29+ </ div >
30+ </ div > <!-- /.container -->
31+
32+ < script type ="text/javascript ">
33+ $ ( function ( ) {
34+ $ ( '#loginButton' ) . click ( function ( ) {
35+ window . location = "https://accounts.spotify.com/authorize?client_id=9950ac751e34487dbbe027c4fd7f8e99&redirect_uri=http:%2F%2Fraw.githubusercontent.com%2Fwatsonbox%2Fexportify%2Fmaster%2Fspotify-export.html&scope=playlist-read-private%20playlist-read-collaborative&response_type=token&state=123" ;
36+ } )
37+
38+ var vars = window . location . hash . substring ( 1 ) . split ( '&' ) ;
39+ var key = { } ;
40+ for ( i = 0 ; i < vars . length ; i ++ ) {
41+ var tmp = vars [ i ] . split ( '=' ) ;
42+ key [ tmp [ 0 ] ] = tmp [ 1 ] ;
43+ }
44+
45+ console . log ( key [ 'access_token' ] ) ;
46+
47+ $ . ajax ( {
48+ url : 'https://api.spotify.com/v1/users/watsonbox/playlists' ,
49+ headers : {
50+ 'Authorization' : 'Bearer ' + key [ 'access_token' ]
51+ } ,
52+ success : function ( response ) {
53+ console . log ( response ) ;
54+ }
55+ } ) ;
56+ } ) ;
57+ </ script >
58+ </ body >
59+ </ html >
You can’t perform that action at this time.
0 commit comments