Reddit Scraper
About
@vedant/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 for helping me fix major part in the code.
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();
Possible errors
Usages
Typescript:
import {Scraper} from "@vedant/reddit";
const manager = new Scraper();
const post = await manager.getFirst('funny');
console.log(post);
console.log(post.titl);
manager.getRandom().then(post => {
console.log(post);
console.log(post.title);
});
Javascript:
const lib = require("@vedant/reddit")
const manager = new lib.Scraper();
const post = await manager.getRandom();
console.log(post);
console.log(post.title);
manager.getLast().then((post) => {
console.log(post);
console.log(post.title);
})