Remove MaxTries variable #51
1 changed files with 2 additions and 4 deletions
|
@ -21,7 +21,7 @@ yarn add random-bunny
|
||||||
import randomBunny from "random-bunny";
|
import randomBunny from "random-bunny";
|
||||||
|
|
||||||
// ... In an async function
|
// ... In an async function
|
||||||
const result = await randomBunny('rabbits', 'hot', 100);
|
const result = await randomBunny('rabbits', 'hot');
|
||||||
console.log(result);
|
console.log(result);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ console.log(result);
|
||||||
|
|
||||||
### `randomBunny()`
|
### `randomBunny()`
|
||||||
|
|
||||||
Returns a `json string` for a random post. Accepts 3 arguments: `subreddit`, `sortby` ('new', 'hot', 'top'), `maxTries?` (default 100)
|
Returns a `json string` for a random post. Accepts 2 arguments: `subreddit`, and `sortby` ('new', 'hot', 'top')
|
||||||
|
|
||||||
The json string which gets returned consists of:
|
The json string which gets returned consists of:
|
||||||
- archived
|
- archived
|
||||||
|
@ -44,8 +44,6 @@ The json string which gets returned consists of:
|
||||||
|
|
||||||
`sortBy` will default to 'hot' if not given or invalid
|
`sortBy` will default to 'hot' if not given or invalid
|
||||||
|
|
||||||
`maxTries` prevents the script from rerolling too many times. The script rerolls the randomiser if the post its given doesn't contain an image. Default 100.
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
* Node 4 or newer.
|
* Node 4 or newer.
|
||||||
|
|
Loading…
Reference in a new issue