LIRI is a Language Interpretation and Recognition Interface. LIRI is a command line node app that takes in parameters and gives you back data.
- Clone the repository.
- Next, create a file named
.env
, add the following to it, replacing the values with your API keys (no quotes) once you have them:
# Spotify API keys
SPOTIFY_ID=your-spotify-id
SPOTIFY_SECRET=your-spotify-secret
# Twitter API keys
TWITTER_CONSUMER_KEY=your-twitter-consumer-key
TWITTER_CONSUMER_SECRET=your-twitter-consumer-secret
TWITTER_ACCESS_TOKEN_KEY=your-access-token-key
TWITTER_ACCESS_TOKEN_SECRET=your-twitter-access-token-secret
-
Get your Twitter API keys by following these steps:
-
Step One: Visit https://apps.twitter.com/app/new
-
Step Two: Fill out the form with dummy data. Type
http://google.com
in the Website input. Don't fill out the Callback URL input. Then submit the form. -
Step Three: On the next screen, click the Keys and Access Tokens tab to get your consume key and secret.
- Copy and paste them into your .env file, replacing the
your-twitter-consumer-key
andyour-twitter-consumer-secret
placeholders.
- Copy and paste them into your .env file, replacing the
-
Step Four: At the bottom of the page, click the
Create my access token
button to get your access token key and secret.- Copy the access token key and secret displayed at the bottom of the next screen. Paste them into your .env file, replacing the placeholders for
your-twitter-access-token-key
andyour-twitter-access-token-secret
.
- Copy the access token key and secret displayed at the bottom of the next screen. Paste them into your .env file, replacing the placeholders for
-
-
Like the Twitter API, the Spotify API requires you sign up as a developer to generate the necessary credentials. You can follow these steps in order to generate a client id and client secret:
-
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 down somewhere, you'll need them to use the Spotify API and the node-spotify-api package.
-
-
Type
npm install
on your command prompt to install node modules from root directory.
liri.js can take in one of the following commands:
* `my-tweets`
* `spotify-this-song`
* `movie-this`
* `do-what-it-says`
-
node liri.js my-tweets
- This will show your last 20 tweets and when they were created at in your terminal/bash window.
-
node liri.js spotify-this-song '<song name here>'
-
This will show the following information about the song in your terminal/bash window and append this information on log.txt file:
-
Artist(s)
-
The song's name
-
A preview link of the song from Spotify
-
The album that the song is from
-
-
If no song is provided then your program will default to "The Sign" by Ace of Base.
-
-
node liri.js movie-this '<movie name here>'
-
This will output the following information to your terminal/bash window and append this information on log.txt file:
* Title of the movie. * Year the movie came out. * IMDB Rating of the movie. * Rotten Tomatoes Rating of the movie. * Country where the movie was produced. * Language of the movie. * Plot of the movie. * Actors in the movie.
-
If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'
-
-
node liri.js do-what-it-says
-
It should run
spotify-this-song
for "I Want it That Way," as follows the text inrandom.txt
. -
Feel free to change the text in that document to test out the feature for other commands.
-