Coder Social home page Coder Social logo

cumulio-spotify-datatalks's Introduction

cumulio-spotify-datatalks

cumulio-spotify repo walk through version for Data Talks 2020

cuMusicalio is an app that integrates a Cumul.io dashboard that displays playlist and song analytics of various playlists and/or a users own playlist of choice if they login to their Spotify account via the app. You can also use the dashboards to add songs to your own Spotify playlists.

This repo contains the boiled down version of the app which is presented as a live coding session at Data Talks 2020. The full version is at cumulio-spotify. All changes here are made to the src/app.js file. Starting with an initial 'skeleton' commit that contains code required for the Spotify API calls, logins and the overall structure of the app, each following commit represents steps to achieve the following:

  1. Integrate a dashboard:
    • Add cumul.io Spotify Playlist dashboard to application
  2. Listen to custom events
  3. On add_to_playlist:
    • Call ui.addToPlaylistSelector(name, id). This will open a Modal that opens the playlists of the person who has logged in. When a playlist is selected, we make a call to the Spotify API to add selected song ID to be added to the selected playlist ID: POST: https://api.spotify.com/v1/playlists/${playlistId}/tracks?uris=spotify%3Atrack%3A${songId}
    • (Extra: Add the event to the table chart and see what you get from the event)
  4. On song_info (for drill-through Song Info dashboard)
    • Get new authorization token with metadata to filter on
    • Integrate Song Info dashboard in Song Info Modal

To run:

  1. npm install
  2. Create a .env file in the root directory and add the following from your Cumul.io and Spotify Developer accounts:

From Cumul.io:

CUMULIO_API_KEY=xxx
CUMULIO_API_TOKEN=xxx

From Spotify:

SPOTIFY_CLIENT_ID=xxx
SPOTIFY_CLIENT_SECRET=xxx
ACCESS_TOKEN=xxx
REFRESH_TOKEN=xxx
  1. npm run start
  2. On your browser, go to http://localhost:3000/ and Login to your Spotify account ๐Ÿฅณ

Note: You do not have to rebuild every time you make a change to this once it's running. Just refresh your browser!

cumulio-spotify-datatalks's People

Contributors

tuanacelik avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.