LIRI is a command line Node.js application run from the terminal.
The user may enter in a variety of different commands, and gets one result at a time.
Clone down repo and using node package manager, npm install
the listed packages into the root directory of the project.
Create a .env
file containing your spotify ID and API Key (Spotify Secret)
SPOTIFY_ID = <YOUR SPOTIFY ID>
SPOTIFY_SECRET= <YOUR UNIQUE API KEY>
Package | Purpose | Link |
---|---|---|
fs | file system integration | nodejs.org/api/fs |
dotenv | set enviornment variables | npmjs.com/package/dotenv |
node-spotify-api | Spotify API | npmjs.com/package/node-spotify-api |
request | Makes calls through http | npmjs.com/package/request |
moment | Formats date/time | npmjs.com/package/moment |
Make sure that all packages have been installed prior to running the code
// enables using hidden global variables
var dot = require('dotenv').config()
// link variables .env file
require('./keys.js');
// file system
require('fs')
// node packages
require('node-spotify-api');
require('request');
require('moment')
concert-this <band>
- Takes in one argument, the name of the band.spotify-this-song <song>
- expects the title of a song and will return information along witha a 30s previewmovie-this <movie>
- Expects a movie title, and will return the plot summary along with actors, year, etcdo-what-it-says
- takes in no arguments, but expects a text file called "random.txt" to include the function and its respective parameter
Adding in functionality to log results in a separate text file
If an artist has a newer version of an old song, it will give the most recent version not OG
Make sure that keys.js
is in the root directory
// keys.js
exports.spotify = {
id: process.env.SPOTIFY_ID,
secret: process.env.SPOTIFY_SECRET,
};
Find the most popular song by an artist
node liri.js spotify-this-song <artist>