Skip to content

kmalillos/liri-node-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIRI Bot Node App

Meet SIRI's distant cousin, LIRI! LIRI is a Language Interpretation and Recognition Interface that can give you details and information for concerts, songs, and movies.

Full Demo: Link

How It Works

LIRI is a command line node app that takes in User inputted parameters and displays data from APIs. LIRI can "understand" the following commands:

  • concert-this artist/band name --> displays upcoming concert of artist/band
  • spotify-this-song song title --> displays song information
  • movie-this movie title --> displays movie details
  • do-what-it-says --> reads from a text file and runs respective function

Full Demo: Link

image

'concert-this' command line input: demo

image

'concert-this' default: demo

image

'spotify-this-song' command line input: demo

image

'spotify-this-song' default: demo

image

'movie-this' command line input: demo

image

'movie-this' default: demo

image

'do-what-it-says' command line input: demo

image

Easter Egg: 'say-hi' command line input: demo

image

Developer Notes

Tools Used:

  • Node.js
    • File System (fs)
  • NPMs - all NPMs
    • Axios
    • Moment
    • Node Spotify API
    • DotEnv
  • APIs
    • Bands In Town API
    • Spotify API
    • OMBD API

Node.js

  • process.argv[] is used to access and capture the command line user inputs. The command line user inputs are stored in variables 'command' and 'search' to be later used in the functions and the main process.

    Image

    • The 'command' variable is used in the main process to call a particular function using 'If-Else Statements.'

    Image

    Image

    • The 'search' variable is used in the API request.

    Image

  • File System(fs) (Link) is built into Node.js and is used to read the file of 'random.txt' in the 'doThis()' function that is triggered by the 'do-what-it-says' command.

    Image

    Image

NPM's:

  • 'package.json' was created using command 'npm init' to save all NPMs and dependencies.

  • Then, all NPMs were installed using command 'npm install '.

  • NPMs were accessed in JavaScript file with a "require" function.

  • Axios NPM (Link) is used to make a .get and .then request from an external API.

    Image

    • It is used here to access: Bands in Town API for the 'concertThis()' function that is triggered by the 'concert-this' command,

    Image

    • and OMBD API for the 'movieThis()' function that is triggered by the 'move-this' command.

    Image

  • Moment NPM (Link) is used to reformat dates. It is used here 'concertThis()' function to reformat the dates in the Bands In Town API to: MM/DD/YYYY.

    Image

    Image

  • Node Spotify NPM (Link) enables the use of the API library for the Spotify REST API.

    Image

    Image

  • DotEnv NPM (Link) loads environment variables from a .env file into process.env, storing configuration in the environment separate from code. This is used to access hidden Spotify API keys.

    Image

    Image

Contributor

Kaylah Malillos

About the Developer: Link

Releases

No releases published

Packages

No packages published