LIRI Bot that retrieves data from Spotify API, OMDb API and Bands In Town API
This app runs API calls which require keys. The Spotify key is not included in this repo.
A .env file must be created in this format to run the spotify-related commands
SPOTIFY_ID[YOUR-SPOTIFY-ID]
SPOTIFY_SECRET=[YOUR-SPOTIFY-SECRET]
This app runs with node.js. If you do not have node.js installed, it will not run. This app also utilizes five node modules as shown being imported below
require("dotenv").config(); //dot env reader
var Spotify = require("node-spotify-api"); //spotify package
var moment = require("moment"); //moment package
var axios = require("axios"); //axios
var fs = require("fs"); //file reader thing
To ensure node is working and the packages are installed run:
$ npm i dotenv
$ npm init -y
$ npm i node-spotify-api
$ npm i axios
$ npm i moment
This node.js bot takes four commands, three of which require a second argument.
$ node liri spotify-this-song [SONG NAME]
$ node liri concert-this [ARTIST OR BAND]
$ node liri movie-this [MOVIE NAME]
The random.txt is formatted as follows
spotify-this-song,"Shoop"
concert-this,"Imagine Dragons"
movie-this,"Casablanca"
To run:
$ node liri do-what-it-says
Liri reads the first input and runs the corresponding function with a switch case. Each command action uses it's own function to run. Except for do-what-it-says, the other cases require a second parameter which is read.
OMDB and Bands in Town ultilize axios to make the API call, while Spotify uses the Spotify node package.