Coder Social home page Coder Social logo

scalarwaves / iloa Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 4.0 417 KB

A command line tool for gaining knowledge.

License: MIT License

JavaScript 100.00%
wikipedia duckduckgo wolfram-alpha encyclopedia-of-life cli noon javascript node nodejs npm-package knowledge information reference

iloa's Introduction

iloa

Build Status Dependency Status npm version Standard - JavaScript Style Guide

Introduction

iloa is Samoan for knowing

iloa is a powerful tool for gaining knowledge from the command line. It queries DuckDuckGo, Encyclopedia of Life, Weather Underground, Wikipedia, Wolfram|Alpha, and more through meta-searches. See the wiki for more info.

Platform

Looking for testers on OSX. Developed and tested on Linux. Works on Windows, see Windows below. Supported Node.js versions:

  • 7.x
  • 6.x
  • 5.x
  • 4.x - Works but it's really slow

Install

Linux installation

To initialize the config file and load themes, your NODE_PATH environment variable must point to the lib/node_modules directory of the Node.js installation. You can set this path automatically like this:

export NP=$(which node)
export BP=${NP%bin/node} #this replaces the string '/bin/node'
export LP="${BP}lib/node_modules"
export NODE_PATH="$LP"

Provided these lines are towards the end of the shell initialization file (at least after any NVM stuff) this should work for a system installation of Node.js and nvm.

Add all of this to .bashrc, .zshrc, etc. then:

npm install -g iloa
iloa config init

Windows installation

I highly recommend using nodist to install Node.js on Windows. It automatically sets %NODE_PATH% for you, though you may have to edit it to make sure it doesn't contain itself (i.e. C:......\node_modules;%NODE_PATH%). If you install Node.js manually, npm install --global leximaven will install the package in C:\Users\username\AppData\Roaming\npm\node_modules. And if you just do npm install leximaven then it will install the package to a subfolder of the Node.js installation, but that won't be the NODE_PATH folder unless you manually set it. Either way, you're going to have to mess around with Windows environment variables to get it to work. And don't forget to put your API keys into an environment variables.

As for getting the ANSI color escape codes to work, Cmder seems to be the easiest way. It doesn't install a full linux environment like Cygwin, but you can still use some linux commands like which, cat, and ls.

Usage

iloa has a built-in help system for CLI parameters and options. Access it with iloa -h|--help [command] [subcommand]. There is also the wiki.

Here are some examples:

// Get DuckDuckGo instant answers for Infected Mushroom
iloa duck 'Infected Mushroom'

// Get Encyclopedia of Life pages for Homo sapiens
iloa life page 327955 -n -d -m -y -r -x

// Get Weather Underground conditions and forecast for Tampa Knight Airport
iloa weather -e conditions,forecast KTPF

// Get Wolfram|Alpha computation of doppler shift
iloa wolfram 'doppler shift'

// Get Wikipedia article for George Gurdjieff
iloa wikipedia 'George Gurdjieff'

See the tests for more.

Resources

The following links can help you use iloa or perform related tasks.

Contributing

See CONTRIBUTING.

License

MIT ยฉ๏ธ 2017 Andrew Prentice

Powered by

DuckDuckGo, Encyclopedia of Life, Weather Underground, Wikipedia, and Wolfram|Alpha

Extras

Take Command

See take-command.

iloa's People

Contributors

drawnepicenter avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

iloa's Issues

Features

  • Alerts
  • Almanac
  • Astronomy
  • Conditions
  • Forecast
  • Geolookup
  • Hourly Forecast
  • Tide
  • Webcams

Things that won't be implemented right now: Current Hurricane, History, Planner, Radar/Satellite, Yesterday.

searx problems

Just working things out

  • Simplify command logic
  • Use format=json instead of scraping
  • Add tofile values
  • Add mirrors to config
  • Implement mirror selector (partially implemented)
  • Use cookie

Qwant

Can this be implemented?

Cache timeout error

wiki command always throws:

**Error retrieving key 'GET|https://en.wikipedia.org/w/api.php?...' from cache:
{ [Error: Timeout expired.] code: 'ETIMEDOUT', message: 'Timeout expired.' }**

Tried disabling cache unsuccessfully. Will try a try-catch-throw block.

Could try using needle instead...

wu

There is already a CLI for wunderground, wu that is worth exploring. It is written in Go.

EOL Features

  • Collections
  • Hierarchy Entries
  • Hierarchy
  • Info
  • Data Objects
  • Pages
  • Provider Hierarchies
  • Providers search
  • Search

Per-command verbosity

Current verbosity checks are not well-defined and verbose is a global value. Could this be improved?

IBM acquisition destroys Weather Underground free API

You can read about all the drama on wunderground.com.
AerisWeather.com is the alternative paid service people are flocking to. F*** that. F*** IBM too. I will either rip weather functionality out of iloa and put it in a separate app or get my data from somewhere else.
๐Ÿ’€ to corporate greed
DarkSky and OpenWeatherMap seem the best alternatives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.