Go to file
Ethan Lane c3b4c5c3e2
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Migrate to Woodpecker CI (#148)
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- Migrate to Woodpecker CI

#131

## Type of change

Please delete options that are not relevant.

- [x] New feature (non-breaking change which adds functionality)

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

# Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/random-bunny/pulls/148
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-02-23 18:28:49 +00:00
.gitea Add Gitea templates 2023-02-24 17:33:39 +00:00
.github Create FUNDING.yml 2021-05-10 21:50:20 +01:00
.gitlab Update default.md 2021-01-15 18:15:14 +00:00
src Add ability to output the CLI in JSON format (#124) 2024-01-19 18:02:16 +00:00
tests Add ability to output the CLI in JSON format (#124) 2024-01-19 18:02:16 +00:00
.eslintignore Setup Jest (#57) 2023-04-22 13:20:30 +01:00
.eslintrc Setup Jest (#57) 2023-04-22 13:20:30 +01:00
.gitignore Add error codes and error messages to failed results (#89) 2023-09-15 15:18:57 +01:00
.gitlab-ci.yml Add aslant to gitlab project ci 2021-01-13 21:08:47 +00:00
.npmignore Setup Jest (#57) 2023-04-22 13:20:30 +01:00
.woodpecker.yml Migrate to Woodpecker CI (#148) 2024-02-23 18:28:49 +00:00
CODE_OF_CONDUCT.md Update documentation with up to date information 2022-08-18 17:45:05 +01:00
CONTRIBUTING.md Fix documentation code breaks (#58) 2023-04-28 17:31:34 +01:00
jest.config.cjs Setup Jest (#57) 2023-04-22 13:20:30 +01:00
jest.setup.js Setup Jest (#57) 2023-04-22 13:20:30 +01:00
LICENSE Update licence copyright to 2023 (#59) 2023-04-28 17:31:55 +01:00
package.json Update dependency commander to v12 (#145) 2024-02-19 14:34:11 +00:00
readme.md Updatr documentation to remove maxTries variable 2023-02-22 18:19:47 +00:00
renovate.json Update 'renovate.json' 2022-12-28 18:43:41 +00:00
tsconfig.json Setup Jest (#57) 2023-04-22 13:20:30 +01:00
yarn.lock Update dependency commander to v12 (#145) 2024-02-19 14:34:11 +00:00

random-bunny

Get a random image url from a subreddit of your choosing.

Install

npm install --save random-bunny

or if you're using yarn

yarn add random-bunny

Usage

import randomBunny from "random-bunny";

// ... In an async function
const result = await randomBunny('rabbits', 'hot');
console.log(result);

API

randomBunny()

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:

  • archived
  • downs
  • hidden
  • permalink
  • subreddit
  • subredditSubscribers
  • title
  • ups
  • url

sortBy will default to 'hot' if not given or invalid

Notes

License

MIT © Vylpes