1.1.21 • Published 5 years ago
extra-quotes v1.1.21
Quotes to share insightful moments. It has popular movie quotes included. You can also load them from Wikiquote, or manually load them to corpora.
console
equotes "try"
# Do, or do not. There is no 'try'.
# :by Star Wars: Episode V - The Empire Strikes Back (1980)
#
# There’s nothing you can’t do if you try.
# :by Dr Stone (2019)
# ...
equotes --load "mahatma gandhi,arnold" "success"
# The late Middle Ages not merely has a successful middle class—it is in fact a middle-class period.
# :by Arnold Hauser (art historian)
#
# Just remember, you can't climb the ladder of success with your hands in your pockets.
# :by Arnold Schwarzenegger
# ...
equotes --load "mahatma gandhi,arnold," "stop try"
## NOTE: last empty load => load default quotes (movies)
# Stop trying to control everything and just let go! LET GO!
# :by Fight Club (1999)
#
# When you stop trying to force the solution, it'll happen on its own.
# :by The Flash (2012)
# ...
equotes --load "mahatma gandhi,arnold," "peace" --ref
# Ideals are peaceful; history is violent.
# :by Fury (2014)
#
# I regard myself as a soldier, though a soldier of peace.
# :by Mahatma Gandhi
# :ref Speech at Victoria Hall, Geneva (10 December 1931)
# ...
export EQUOTES_LOAD="mahatma gandhi,arnold,"
equotes "peace" --random --limit 1
## lists a random quote
reference
equotes [options] [query]
# query: text to match in quotes
# Options:
# --help: show this help
# --silent: hide error messages (0/1)
# --by: display "by" field (0/1)
# --ref: display "ref" field (0/1)
# --load: load quotes from wikiquote ('query,query,...')
# -a | --all: load all matching search results (0/1)
# --from: display quotes from corpus ('name,name,...', null => all)
# -f | --filter: filter quotes by ('js function')
# -r | --random: randomly shuffle quotes (0/1)
# -l | --limit: limit number of quotes (integer, -1 => all)
# Environment variables:
$EQUOTES_SILENT # hide error messages (0)
$EQUOTES_BY # display "by" field (1)
$EQUOTES_REF # display "ref" field (0)
$EQUOTES_LOAD # load quotes from wikiquote ('')
$EQUOTES_ALL # load all matching search results (1)
$EQUOTES_FROM # choose from a subset of corpora (null)
$EQUOTES_FILTER # filter quotes by ('q => q.text.length<=160')
$EQUOTES_RANDOM # randomly shuffle quotes (0)
$EQUOTES_LIMIT # limit number of quotes (-1)
javascript
const quotes = require('extra-quotes');
async function main() {
await quotes.load();
/* loads local movies quotes (corpus) */
// true
quotes('try');
// [ { text: "Do, or do not. There is no 'try'.",
// by: 'Star Wars: Episode V - The Empire Strikes Back (1980)',
// ref: null },
// { text: 'There’s nothing you can’t do if you try.',
// by: 'Dr Stone (2019)',
// ref: null }, ... ]
await quotes.load('mahatma gandhi');
/* loads Mahatma Gandhi quotes from Wikiquote */
// true
await quotes.load('arnold');
/* loads Arnold... quotes from Wikiquote */
// true
quotes('stop try');
// [ { text: 'Stop trying to control everything and just let go! LET GO!',
// by: 'Fight Club (1999)',
// ref: null },
// { text:
// "When you stop trying to force the solution, it'll happen on its own.",
// by: 'The Flash (2012)',
// ref: null }, ... ]
quotes('', null, {random: true, limit: 1});
// -> 1 random quote
}
main();
reference
Method | Action |
---|---|
quotes | Lists matching quotes. |
load | Loads quotes from Wikiquote, or local (movies). |
set | Manually sets quotes, with specified name. |
delete | Deletes loaded / manually set quotes (from corpora). |
Browserified, minified version of this package is extra-quotes.min.
1.1.21
5 years ago
1.1.19
5 years ago
1.1.18
5 years ago
1.1.17
5 years ago
1.1.20
5 years ago
1.1.16
5 years ago
1.1.15
5 years ago
1.1.12
5 years ago
1.1.11
5 years ago
1.1.14
5 years ago
1.1.13
5 years ago
1.1.9
5 years ago
1.1.8
5 years ago
1.1.10
5 years ago
1.1.7
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.9
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago
0.0.11
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.3
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago