npm.io
1.0.9 • Published 5 years ago

bee-api

Licence
ISC
Version
1.0.9
Deps
1
Size
8 kB
Vulns
0
Weekly
0

alt text

Bee API

A minimalistic Api to fetch information from reddit

Table of Contents

  1. ChangeLog.
  2. Description.
  3. Usage.
  4. Options.
  5. Details.
  6. Contact information.

1. ChangeLog

  • You can new sort for new posts

2. Description

A simple and fast wrapper for fetching data from reddit posts.

3. Usage

const api = require('bee-api');

api({
    subreddit: 'cat',
    allowNSFW: false,
    allowModPost: true,
    allowCrossPost: true,
    allowVideo: true,
    newPosts: true
}).then(post => {
    console.log(post);
});

4. Options

Field Type Description Default
subreddit String .... N/A
allowNSFW boolean whether or not the returned post can be marked as NSFW false
allowModPost boolean whether or not the returned post can be distinguished as a mod post false
allowCrossPost boolean whether or not the returned post can be a crosspost false
allowVideo boolean whether or not the returned post can be a video false
newPosts boolean whether or not the returned post is a new post false

5. Details

  • By default, the Reddit JSON API should not return any removed or deleted posts.
  • Unhandled rejections can be caught and handled:
bla bla bla bla bla
}).then(post => {
    // some code here
}).catch(e => {
    console.error(`Rejection: ${e}`);
});

6. Contact information

  • Discord: Nemijah#6392
  • Email: hopetobylol@gmailcom
  • Github: DaatUserName
  • Discord server: https://discord.gg/3MAuPMjh7f
  • feel free to ping me

Future updates

  • imgur api

Keywords