Language Interpretation and Recognition Interface: LIRI is a command line node.js app that takes in parameters and gives you back data.
- Powered by Javascript and node.js, including npm request, node-spotify-api, moment, and dotenv!
Follow the instructions below to browse the application.
- Download node.js to properly utilize this application!
- Clone down this repository to your local desktop. All dependencies have been fulfilled.
- Once downloaded, head to your terminal and direct yourself to the location of the LIRI directory.
- Type in node liri to run the program and see a list of commands! See preview below
The application has been authorized by Spotify!
- Javascript - the primary scripting logic powering the game
- node.js - a versatile Javascript runtime environment that processes user inputs in terminal
- Moment.js - a date-time Javascript library to enable ease of time manipulation
- Spotify API -
require("node-spotify-api");
- Request -
require("request");
- Chalk -
require("chalk");
Explanation
//import keys.js and node-spotify-api so that we can access the spotify export
var keys = require("./keys.js");
var Spotify = require('node-spotify-api');
var spotify = new Spotify(keys.spotify);
function spotifySearch(){
if(searchTerm){
spotify.search({ type: 'track', query: searchTerm }, function(err, data) {
if (err) {
return console.log('Error occurred: ' + err);
}
// console.log(data.tracks.items[0]);
console.log("Artist: " + data.tracks.items[0].artists[0].name);
console.log("Song Name: " + data.tracks.items[0].name);
console.log("Spotify Preview Link: " + data.tracks.items[0].external_urls.spotify);
console.log("Album: " + data.tracks.items[0].album.name);
});
}
else{
spotify.search({ type: 'track', query: "The Sign by Ace of Base" }, function(err, data) {
if (err) {
return console.log('Error occurred: ' + err);
}
console.log(data.tracks.items[0]);
});
}
}
- node.js proved to be a powerful tool to divvy requests and inquiries that fit the user's needs. For the future, it may be useful to spend time researching node's capabilities and more effective debugging methods
- Moment JS allows developers to interact more fluidly with a generally difficult-to-deal-with user input - time
- Sajeel Malik - Initial work - GitHub
This project is licensed under the MIT License - see the LICENSE.md file for details