@vedantsharma/reddit
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Reddit Scraper

About

@vedantsharma/reddit is a nodejs library coded using javascript to make work for coders who are using the raw reddit api to make there lives easier. Thanks to Ric and Sam for helping me remove the irrelevant part and fixing bugs.

Errors

If you guys face errors while using this library then make an issue. I'm currently busy with exams and will fix them later.

Installation

npm install @vedantsharma/reddit

Overview

The parameters are optional. So... the default subreddits are "dankmemes" and "wholesomememes".

Below are the Given Methods.

getRandom();
getLast();
getFirst();

before using all this, you have to set up the instances, which is by doing the given:

import {Scraper} from "@vedant/reddit";
const a = new Scraper();

Usages/Examples

  • Typescript
import {Scraper} from "@vedantsharma/reddit";

const manager = new Scraper();

const post = await manager.getFirst('funny'); // Leaving this empty would use the default subreddits as given on 
console.log(post); // Print out the Reddit Post Object.
console.log(post.title); // Print out the title of the reddit post.
  • Javascript
const lib = require("@vedantsharma/reddit");

const manager = new lib.Scraper();
manager.getFirst('funny').then(post => {
    console.log(post);
});

Package Sidebar

Install

npm i @vedantsharma/reddit

Weekly Downloads

0

Version

2.0.1

License

ISC

Unpacked Size

20.3 kB

Total Files

21

Last publish

Collaborators

  • vedantsharma