Skip to content

Commit

Permalink
feat: add api usage option
Browse files Browse the repository at this point in the history
  • Loading branch information
drawnepicenter committed Aug 1, 2016
1 parent 9495890 commit 67ff191
Show file tree
Hide file tree
Showing 26 changed files with 38 additions and 36 deletions.
4 changes: 2 additions & 2 deletions build/cmds/dmuse_cmds/get.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/onelook.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/rhymebrain_cmds/combine.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/rhymebrain_cmds/info.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/rhymebrain_cmds/rhyme.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/define.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/example.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/hyphen.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/origin.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/phrase.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/pronounce.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/cmds/wordnik_cmds/relate.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions default.config.noon
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ rbrain
theme square
urban
limit 5
usage true
verbose false
wordmap
limit 1
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/dmuse_cmds/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.dmuse.date.remain}/${config.dmuse.date.limit} requests remaining today.`)
} else {
console.log(`${config.dmuse.date.remain}/${config.dmuse.date.limit} requests remaining today, will reset in ${23 - hours} hours, ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.dmuse.date.remain}/${config.dmuse.date.limit} requests remaining today, will reset in ${23 - hours} hours, ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/onelook.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.onelook.date.remain}/${config.onelook.date.limit} requests remaining today.`)
} else {
console.log(`${config.onelook.date.remain}/${config.onelook.date.limit} requests remaining today, will reset in ${23 - hours} hours, ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.onelook.date.remain}/${config.onelook.date.limit} requests remaining today, will reset in ${23 - hours} hours, ${59 - minutes} minutes.`)
}
})
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/rhymebrain_cmds/combine.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/rhymebrain_cmds/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/rhymebrain_cmds/rhyme.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.rbrain.date.remain}/${config.rbrain.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/define.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/hyphen.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/origin.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/phrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/pronounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
2 changes: 1 addition & 1 deletion src/cmds/wordnik_cmds/relate.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ exports.handler = (argv) => {
if (reset) {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour.`)
} else {
console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
if (config.usage) console.log(`${config.wordnik.date.remain}/${config.wordnik.date.limit} requests remaining this hour, will reset in ${59 - minutes} minutes.`)
}
} else {
throw new Error(`HTTP ${response.statusCode}: ${error}`)
Expand Down
1 change: 1 addition & 0 deletions test/test.config.noon
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ rbrain
theme square
urban
limit 5
usage true
verbose false
wordmap
limit 1
Expand Down

0 comments on commit 67ff191

Please sign in to comment.