Socket
Socket
Sign inDemoInstall

node-reddit-wrapper

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-reddit-wrapper

Node wrapper for Reddit's API.


Version published
Weekly downloads
4
Maintainers
1
Install size
794 kB
Created
Weekly downloads
 

Readme

Source

node-reddit-wrapper

CI License: MIT

A simple node wrapper used by Industrial Parasite to post new releases to it's subreddit.

Installation


npm:

npm install node-reddit-wrapper --save

yarn:

yarn add node-reddit-wrapper

Feature


  • Wrap Reddit's API
  • Use native promise and async functions.
  • Functional design

Usage


  1. Create reddit app.
    a) Click create app located at the bottom of the link above.
    b) Add app info; selecting script as the type and adding any url for about url and redirect uri
  2. Create a credentials object.
const credentials = {
    "appId":  "YOUR_APP_ID",
    "appSecret": "YOUR_APP_SECRET",
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD"
}
  1. Make a post to your subreddit.
await reddit(
  '/api/submit', // Reddit API PATH
  'POST', // Method (currently only supports POST)
  {
    flair_id: 'bd2aa23a-4159-11ea-8d7e-0ed477f315f3',
    kind: 'link',
    resubmit: true,
    title: 'Ae/Sthetic - Polaris',
    sr: 'IndustrialParasite',
    url: 'https://industrialparasite.ffm.to/ae-sthetic-polaris',
  },
  credentials // The credentials object we created in step 2.
);

To Do


  • Improve response handling
  • Add Get
  • Add Put
  • Add Delete

Meta


Industrial Parasite@IndustrialPara

Distributed under the MIT license. See LICENSE for more information.

https://github.com/Industrial-Parasite/node-reddit-wrapper

Contributing


  1. Fork it
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'feat: THE FEATURE')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

FAQs

Last updated on 07 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc