node-reddit-wrapper
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
- 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
- Create a credentials
object
.
const credentials = {
"appId": "YOUR_APP_ID",
"appSecret": "YOUR_APP_SECRET",
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
}
- Make a post to your subreddit.
await reddit(
'/api/submit',
'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
);
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
- Fork it
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'feat: THE FEATURE'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request