Skip to content

Liri - Like Siri ... Yet runs cross platform - a command line utility for running tasks. You give Liri commands and Liri gives you data.

Notifications You must be signed in to change notification settings

shopglobal/liri

Repository files navigation

Build Status

Build Status

LIRI BOT

    ___      _    __          __ 
   / (_)____(_)  / /_  ____  / /_
  / / / ___/ /  / __ \/ __ \/ __/
 / / / /  / /  / /_/ / /_/ / /_  
/_/_/_/  /_/  /_.___/\____/\__/  

Current Version: 2.0.7-stable

Help README

LIRI is similar to CORTANA or SIRI in the fact that it can find out information for you. You can check out the latest information about your favorite songs, look into your favorite movies by searching the name, define words, check the weather, and check out all the latest posts from the twitter feed.
Enjoy your experience with LIRI.

demo

Here is how to use LIRI:

The [COMMAND] is what you command LIRI to do, and the [ARGUMENTS] are the parameters that you need to pass to LIRI to get what you are looking for. The [ARGUMENTS] will change determined by user input based on what you are looking for, or trying to do.

Breaking down the Code

Let's setup a couple of Global Enviornment Variables. Let's take a look at the processes in Node which handle these queries for the app. . . process.argv = user inputs

//start listening to user inputs in the state var nodeArgs = process.argv;

//create an array for user inputs var argArray = [];

//assign commands and titles from user inputs var command = nodeArray[2]; var input = [];

Establish user input as length of all of the arguments, determined by the user input which is needed for a proper query with Request. To do this, we must loop through the user inputs like so; for(k=3; k < nodeArray.length; k++){ input.push(nodeArray[k]); }

Understanding the need for User Input loop, how-to do it (I did it, you can too!) and the reason for it, is the below illustration:

boolean

Take this string of numbers for example, look at the boolean value of each integer and then think of the remainder as > your favorite number. (ex. the index you need for your code to function)

0 > 1 > 2 > 3 > 3 > 3 > 3 > 3 > 3 > 3 > 3

command

Take this LIRI command for example and look at the value of the first input which matters to your code:

==/~ 0 _ 1____2_______3_____>3___>3___>3 =====>>>>>

/~ node liri movie "really long movie title"

The input's matter, to your code, and we handle this carefully by implementing the following loop:

for

Take a look at this quick for loop I created which takes in user inputs, and establishes origin to a predefined index of 3. Which is where the important user input is located: for (l=3; l < nodeArgs.length; l++){ argArray.push(nodeArgs[l]); }

Pre-Installation

You must have a Spotify API Key & Secret and Also a Twitter Access Token & Secret in order for those functions to work. Prior to attemtping installation, visit both site and create your API access tokens in the following manner:

Spotify - save file to root as spotifykeys.js

const chalk = require("chalk");
console.log(chalk.green('Spotify keys loaded'));

var Spotify = require('node-spotify-api');
var spotifyKeys = new Spotify({
  id: 'enter-your-spotify-id',
  secret: 'enter-spotify-secret',
});


module.exports = spotifyKeys;

Twitter - save file to root as twitterkeys.js

const chalk = require("chalk");
console.log(chalk.green('Twitter keys loaded'));
var Twitter = require('twitter');

var twitterKeys = new Twitter({
  consumer_key: 'twitter-consumer-key',
  consumer_secret: 'twitter-consumer-secret',
  access_token_key: 'twitter-access-token-key',
  access_token_secret: 'twitter-access-token-secret',
});

module.exports = twitterKeys;

Installation

Clone this repository: git clone https://github.com/shopglobal/liri.git Install dependancies npm install Run liri with node app, or node liri node app [commands] [argumentsLoop] For example node liri tweets [username] node liri movies [movie Name] node liri song [song Name] node liri get-weather [name of place]

Getting Started:

/~ node liri.js init

init

When you run the liri.js file using the console. You just have to type the following into the terminal:

/~ node liri.js (COMMAND) (ARGUMENT)

/~ node liri.js prompt

prompt

Examples:

/~ node liri.js get-tweets [ARGUMENTS]

get-tweets

This will return your last 20 tweets that you have tweeted.

/~ node liri.js my-tweets

tweets

/~ node liri.js spotify-this-song [ARGUMENTS]

spotify-this-song

/~ node liri.js spotify-this-song "Money Pink Floyd"

This will return the song titled Money by Pink Floyd and will also give the artist, album, and a URL that will give you a 30 second preview of the song.

/~ node liri.js movie-this [ARGUMENTS]

movie-this

/~ node liri.js movie-this Guardians of the Galaxy

This will return a movie with the title Guardians of the Galaxy and give you a quick synopsis of the movie and a link where there to find out more information about the movie.

MORE INFORMATION:

You can always ask LIRI for help at:

/~ node liri.js help

help

Learn more about LIRI with the following command:

/~ node liri.js about

about

Check the status of your LIRI app & version at:

/~ node liri.js status

status

MORE FEATURES:

/~ node liri.js get-weather [ARGUMENTS]

get-weather

/~ node liri.js count-to [ARGUMENTS]

count

/~ node liri.js do-what-it-says

do-what-it-says

About

Liri - Like Siri ... Yet runs cross platform - a command line utility for running tasks. You give Liri commands and Liri gives you data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published