Giter VIP home page Giter VIP logo

wikiquote-cli's Introduction

wikiquote-cli

Build Status NPM Version Coverage

Companion CLI for wikiquote package (https://github.com/fdesjardins/wikiquote)

Install

$ npm install -g wikiquote-cli

Usage

$ wikiquote -h

Get quotes from Wikiquote

Usage: wikiquote <cmd> [options]

Commands:
  wikiquote cache <cmd>            issue cache commands
  wikiquote list <name>            list quotes for a page name
  wikiquote random <name>          get a random quote from a page
  wikiquote search <query>         search for page names
  wikiquote completion             generate bash completion script

Options:
  -v, --version  Show version number                           [boolean]
  -h, --help     Show help                                     [boolean]

Examples:
  wikiquote random "Steve Jobs"
  wikiquote search "bill gates"

Cache & Offline Usage

You can speed up quote retrieval and store quotes by using the cache command:

Commands:
  wikiquote cache add <name>     cache quotes for a give page
  wikiquote cache clear <name>   clear the local cache
  wikiquote cache update <name>  update the local cache

Examples

Adding cache entries:

$ time wikiquote random 'Abraham Lincoln'
# 2.02s user 0.11s system 85% cpu 2.503 total

$ wikiquote cache add 'Abraham Lincoln'
Added "Abraham Lincoln" to cache

$ time wikiquote random 'Abraham Lincoln'
# 0.33s user 0.04s system 111% cpu 0.338 total

Use with other programs:

$ wikiquote random "Nikola Tesla" | cowsay
 _________________________________________
/ We crave for new sensations but soon    \
| become indifferent to them. The wonders |
| of yesterday are today common           |
\ occurrences. -- Nikola Tesla            /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

License

MIT © Forrest Desjardins

wikiquote-cli's People

Contributors

dependabot[bot] avatar fdesjardins avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wikiquote-cli's Issues

allow passing the language option

to allow fetching quotes from foreign languages. e.g.:

wikiquote random "I_Simpson" --language it
# will fetch from https://it.wikiquote.org/wiki/I_Simpson

Add local database/cache

It'd be nice to have a way to locally cache certain API responses, especially for actions like random, so they can be fast enough to use on terminal startup, etc.

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.