项目作者: farhajawed

项目描述 :
LIRI is a command line node app that takes in parameters and gives you back data.
高级语言: JavaScript
项目地址: git://github.com/farhajawed/liri-node-app.git
创建时间: 2018-06-08T04:24:25Z
项目社区:https://github.com/farhajawed/liri-node-app

开源协议:

下载


LIRI Bot

Overview

LIRI is a Language Interpretation and Recognition Interface. LIRI is a command line node app that takes in parameters and gives you back data.

Set up

  1. Clone the repository.
  2. Next, create a file named .env, add the following to it, replacing the values with your API keys (no quotes) once you have them:
  1. # Spotify API keys
  2. SPOTIFY_ID=your-spotify-id
  3. SPOTIFY_SECRET=your-spotify-secret
  4. # Twitter API keys
  5. TWITTER_CONSUMER_KEY=your-twitter-consumer-key
  6. TWITTER_CONSUMER_SECRET=your-twitter-consumer-secret
  7. TWITTER_ACCESS_TOKEN_KEY=your-access-token-key
  8. TWITTER_ACCESS_TOKEN_SECRET=your-twitter-access-token-secret
  1. 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 and your-twitter-consumer-secret placeholders.
    • 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 and your-twitter-access-token-secret.
  2. 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:

  3. Type npm install on your command prompt to install node modules from root directory.

Functionality

liri.js can take in one of the following commands:

  1. * `my-tweets`
  2. * `spotify-this-song`
  3. * `movie-this`
  4. * `do-what-it-says`
  1. node liri.js my-tweets

    • This will show your last 20 tweets and when they were created at in your terminal/bash window.
  2. 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.

  3. 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:

      1. * Title of the movie.
      2. * Year the movie came out.
      3. * IMDB Rating of the movie.
      4. * Rotten Tomatoes Rating of the movie.
      5. * Country where the movie was produced.
      6. * Language of the movie.
      7. * Plot of the movie.
      8. * Actors in the movie.
    • If the user doesn’t type a movie in, the program will output data for the movie ‘Mr. Nobody.’

  4. node liri.js do-what-it-says

    • It should run spotify-this-song for “I Want it That Way,” as follows the text in random.txt.

      • Feel free to change the text in that document to test out the feature for other commands.