GithubHelp home page GithubHelp logo

kehontas / spotify-search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sf-wdi-25/spotify-search

0.0 3.0 0.0 25 KB

Search and display Spotify tracks using AJAX and jQuery

HTML 83.45% CSS 2.88% JavaScript 13.67%

spotify-search's Introduction

Spotify Search

Objective: Make a music search app using jQuery, AJAX, and the Spotify API. You'll be using Spotify's search endpoint to search for tracks (songs).

Minimum Requirements

  1. Your app must have a form to search for tracks (songs). The form needs an input field for the search keyword.
  2. When a user submits the form, use jQuery to get the search keyword from the form input.
  3. Use AJAX to call Spotify's search endpoint with the search keyword from the form.
  4. On success of the AJAX call, render the search results on the page. You should include at least the track name and artist name.
  5. Each time the user submits the form, clear the previous search results from the view.

Bonus

  1. Display a track's album artwork next to each search result in the view. Hint: You'll notice if you try to access the album artwork but none is available, your app will break. Prevent this from happening with a check to see if any artwork is available first.
  2. Spotify gives us a preview_url for each track. Create a play button for each track in your view that opens the preview_url in a new tab (it will start playing the song!).
  3. It would be nice to let the user know something is happening in the few milliseconds between submitting the form and getting data on the page. Show loading.gif when the form submits, and hide it when you get data back from Spotify.
  4. Handle the case where no data comes back from Spotify. You'll want to let the user know that there are no results, rather than just showing a blank page.

Getting Started

  1. Fork this repo, and clone it into your devel folder on your local machine.
  2. Practice querying Spotify's search endpoint using Postman with a couple different search keywords. You'll want to set type=track in your request URL. Look at the response data, and figure out how you would access the track name and artist name for a particular track (this will involve accessing values from nested objects and arrays).
  3. Once you feel comfortable with the structure of the response data, work on using AJAX to make the API call to Spotify when the user submits the form.
  4. Start by console.log-ing the response data. Once you have that working, access the data you need (track name and artist name), and use jQuery to append it to the page. Hint: You'll need to use Array#forEach to iterate through all the tracks Spotify returns in the response data.

Submission

  • As you make code changes, frequently commit and push to GitHub.
  • Once you've finished the assignment and pushed your work to GitHub, make a pull request from your fork to the original repo.
    • Note the pull-request will not be merged, as all other students' work would then conflict.

Resources

spotify-search's People

Contributors

cameronjacoby avatar tgaff avatar

Watchers

James Cloos avatar Kehontas 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.