<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.9&appId=644549258920542";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

crickets

daft punk

St paul

wynona ryder

 

<p>Hello, World!</p>

Hello, World!

  $.ajax({
      url: 'https://api.spotify.com/v1/users/wanderlustfest/playlists/5ehqaKNCIjtIuwNOALskcK/followers',
      headers: {
         'Authorization': 'Bearer ' + <your_access_token>
      },
      method: 'PUT',
      success: function() {
          // do something
      },
      dataType: 'html',
      error: function(e) {
          console.error(e);
      }
  });
Embed Block
Add an embed URL or code. Learn more

Hello, World!

Follow a Playlist

(function() {
    
    function login(callback) {
        var CLIENT_ID = '6b284830006843e7ae7b170725715aed';
        var REDIRECT_URI = 'http://jmperezperez.com/spotify-oauth-jsfiddle-proxy/';
        function getLoginURL(scopes) {
            return 'https://accounts.spotify.com/authorize?client_id=' + CLIENT_ID +
              '&redirect_uri=' + encodeURIComponent(REDIRECT_URI) +
              '&scope=' + encodeURIComponent(scopes.join(' ')) +
              '&response_type=token';
        }
        
        var url = getLoginURL([
            'playlist-modify-public'
        ]);
        
        var width = 450,
            height = 730,
            left = (screen.width / 2) - (width / 2),
            top = (screen.height / 2) - (height / 2);
    
        window.addEventListener("message", function(event) {
            var hash = JSON.parse(event.data);
            if (hash.type == 'access_token') {
                callback(hash.access_token);
            }
        }, false);
        
        var w = window.open(url,
                            'Spotify',
                            'menubar=no,location=no,resizable=no,scrollbars=no,status=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left
                           );
        
    }

    function followPlaylist(accessToken, playlistUri) {
        var parts = playlistUri.split(':');
        $.ajax({
            url: 'https://api.spotify.com/v1/users/' + parts[2] + '/playlists/' + parts[4] + '/followers',
            headers: {
               'Authorization': 'Bearer ' + accessToken
            },
            method: 'PUT',
            success: function() {
                followButton.textContent = 'Following';
            },
            dataType: 'html',
            error: function(e) {
                console.error(e);
            }
        });
    }

    var followButton = document.getElementById('btn-follow'),
        playlistUriInput = document.getElementById('playlist-uri');
    
    followButton.addEventListener('click', function() {
        login(function(accessToken) {
            followPlaylist(accessToken, playlistUriInput.value);
        });
    });
    
})();
archive Block
This is example content. Double-click here and select a page to create an index of your own content. Learn more
<p>Hello, World!</p>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
 
   
 
   $(function() {
     var article = $('.collection-type-blog article.hentry');
     
     article.each( function() {
       var like = $(this).find('.sqs-simple-like'),
           likeCount = like.find('.like-count'),
           likeNumber = like.attr('data-like-count');
           title = $(this).find('.entry-title');
       
       likeCount.html( likeNumber );
       like.prependTo( title );
     });
   });
 
 </script><script type="text/javascript" data-sqs-type="imageloader-bootstraper">(function() {if(window.ImageLoader) { window.ImageLoader.bootstrap(); }})();</script>
 <script>Squarespace.afterBodyLoad(Y);</script>
 
     </body>
 </html>