juicypasta / reddit-snooper Goto Github PK
View Code? Open in Web Editor NEW๐ค Simple Reddit bot framework for Nodejs.
License: Apache License 2.0
๐ค Simple Reddit bot framework for Nodejs.
License: Apache License 2.0
Request: allow multi (me/m) watching. I'm going to work on this and may submit a pull request if I get it working.
If I install via nom install --save reddit-snooper
, I don't have access to the getMultiWatcher
function.
If you subscribe to commets/posts of a subredit which doesn't exist (because it has been deleted) the module crashes with a null pointer exception in watcher.js line 67:
let children = body.data.children
body.data is undefined in that case. Please add add check for this and return a proper error instead.
version: 1.0.1
Right now it's possible to listen for comments across Reddit or a specific sub. Is it possible to watch for comments on multis?
There appears to be an issue with using the "url" npm library, specifically line 84 of api.js. First of all, in the url module that was installed, url.URL is not a function. Then url.Url().toString() returned an object.
My fix:
construct_url(path) {
let oauth_endpoint = "https://oauth.reddit.com"
return `${oauth_endpoint}${path}`;
}
Using the following snippet results in the message Requested too many items (reddit does not keep this large of a listing)
:
this._snooper.watcher.getPostWatcher('all')
.on('post', function(post) {
//...
})
.on('error', console.error)
This is my configuration (taken from the README):
this._snooper = new Snooper({
app_id: '<redacted>',
api_secret: '<redacted>',
user_agent: '<redacted>',
automatic_retries: true,
api_requests_per_minuite: 60
});
When I start a watcher for a subreddit, e.g.
snooper.watcher.getPostWatcher('subreddit')
everything works correctly, but if I try to get the top posts of such subreddit, e.g.
snooper.watcher.getPostWatcher('subreddit/top')
or the controversial ones e.g.
snooper.watcher.getPostWatcher('subreddit/controversial')
I alway get this: "Requested too many items (reddit does not keep this large of a listing)"
Am I missing something here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.