@vedantsharma/reddit
Advanced tools
Comparing version 1.0.6 to 1.0.7
13
index.js
@@ -1,6 +0,7 @@ | ||
const s = require("@vedantsharma/reddit"); | ||
const manager = new s.Scraper(); | ||
manager.getRandom("funny").then((post) => { | ||
console.log(post); | ||
}) | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Scraper = exports.RedditPost = void 0; | ||
var redditPost_1 = require("./redditPost"); | ||
Object.defineProperty(exports, "RedditPost", { enumerable: true, get: function () { return redditPost_1.RedditPost; } }); | ||
var apiManager_1 = require("./apiManager"); | ||
Object.defineProperty(exports, "Scraper", { enumerable: true, get: function () { return apiManager_1.Scraper; } }); |
import * as https from 'https'; | ||
import { RedditPost } from './redditPost'; | ||
import { RedditPost } from '../redditPost'; | ||
import * as http from 'http'; | ||
export class Scraper { | ||
private subredditBase: string = 'https://www.reddit.com/<subreddit>.json?limit=100'; | ||
private subredditBase: string = 'https://www.reddit.com/'; | ||
private subreddits: Array<string> = ['dankmemes', 'wholesomememes']; | ||
@@ -13,3 +13,5 @@ private randomSubreddit: string = this.subredditBase?.replace('<subreddit>', this.subreddits[Math.floor(Math.random() * this.subreddits.length)]); | ||
constructor() { }; | ||
constructor() { | ||
this.subredditBase = 'https://www.reddit.com/<subreddit>.json?limit=100'; | ||
}; | ||
@@ -16,0 +18,0 @@ private get(subredditUrl: string) { |
@@ -1,2 +0,2 @@ | ||
export { RedditPost } from "./redditPost"; | ||
export { Scraper } from "./apiManager"; | ||
export { RedditPost } from "../redditPost"; | ||
export { Scraper } from "../apiManager"; |
{ | ||
"name": "@vedantsharma/reddit", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Reddit Library for Nodejs and Typescript", | ||
"main": "dist/index.js", | ||
"main": "index.js", | ||
"keywords": [ | ||
@@ -35,4 +35,4 @@ "reddit api", | ||
"dependencies": { | ||
"@vedantsharma/reddit": "^1.0.5" | ||
"@vedantsharma/reddit": "^1.0.6" | ||
} | ||
} |
@@ -9,4 +9,3 @@ { | ||
"skipLibCheck": true, | ||
"outDir": "./dist/" | ||
} | ||
} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
12843
12
247
1
Updated@vedantsharma/reddit@^1.0.6