I am currently a student in the UT Austin Coding Bootcamp. after spending a few months on client-side development, we are beginning to learn about the back-end. Our week 12 assignment is to create a command line node app that takes in certain parameters and gives back data. It’s called LIRI, Language Interpretation and Regognition Interface…a play on SIRI.
You will need to clone this repository.
You will then need to create your own .env
file to hold your Spotify Client IDs. The Spotify portion of this app will not work unless you do this.
In the root folder create a file named .env
.
Add the following to it, replacing the values with your Spotify API keys (no quotes) once you have them:
#### Spotify API keys
SPOTIFY_ID=your-spotify-id
SPOTIFY_SECRET=your-spotify-secret
These keys can be found by signing up as a developer on Spotify. Here is how you do that:
Step One: Visit https://developer.spotify.com/my-applications/#!/
Step Two: Either login to your existing Spotify account or create a new one (a free account is fine) and log in.
Step Three: Once logged in, navigate to https://developer.spotify.com/my-applications/#!/applications/create to register a new application to be used with the Spotify API. You can fill in whatever you’d like for these fields. When finished, click the “complete” button.
Step Four: On the next screen, scroll down to where you see your client id and client secret. Copy these values into your .env
file.
You will also need a few Node packages for this all to work. From the root folder for this app in your command line, install the following:
npm install node-spotify-api
into your command line. Allow it to finish installing then move on to the next…npm install request
into your command line. Allow it to finish installing then move on to the next…npm install moment
into your command line. Allow it to finish installing then move on to the next…npm install dotenv
into your command line. Allow it to finish installing then move on to the next…npm install chalk
into your command line. Allow it to finish installing then…you’re finished!Bands In Town
Allows you to query ‘Bands In Town Artists Events API’ by typing the following into your command line:
node liri.js concert-this <artist/band name here>
The app will then give you the following information for five concerts:
Here is how it will look:
Spotify
Allows you to query the ‘Spotify API’ by typing the following into your command line:
node liri.js spotify-this-song '<song name here>'
The app will then give you the following information:
Here is how it will look:
OMDB
Allows you to query the ‘OMDB API’ by typing the following into your command line:
node liri.js movie-this '<movie name here>'
The app will then give you the following information:
Here is how it will look:
Do what it says
Type this into your command line and try it out:
node liri.js do-what-it-says
Here is how it will look: