Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-reddit-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-reddit-wrapper

Node wrapper for Reddit's API.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 07 Oct 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc