Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reddit-user-dump

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-user-dump

dumps a redditor's history in json

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

reddit-user-dump

scrapes a reddit user's complete post history

(thanks to max ogden for inspiration https://github.com/maxogden/subreddit-youtubes)

NEW: you can also pass in a second argument that will stop parsing if the comment is older than a given 'created' value

install

npm install reddit-user-dump

example

var lastParsed = 0;

function wrapper(username, callback) {
    var test = require('../index.js')
    console.log(test);

    var submissionCount = 0;
    var commentCount = 0;
    var total = 0;

    test(username, lastParsed)
        .on('user', function(userObj) {
            console.log(userObj);
        })
        .on('submission', function(submission) {
            submissionCount += 1;
        })
        .on('comment', function(comment) {
            //console.log('comment found!');
            commentCount += 1;
        })
        .on('page', function(after, count) {
            total += count;
            console.log('page complete found',
                'submission: ', submissionCount, 'comment', commentCount, 'total', total);
        })
        .on('data', function(obj) { //this is a comment or submission that is pushed
            if (obj.data.created > lastParsed) lastParsed = obj.data.created;
        })
        .on('end', function() {
            console.log('end')
            console.log('parse complete found',
                'submission: ', submissionCount, 'comment', commentCount, 'total', total);
            callback();
        })
        .on('error', function(err) {
            console.log('err', err)
        });
}
wrapper('hortinstein', function(e, r) {
    wrapper('hortinstein', function() {

    });
})

license

BSD

Keywords

FAQs

Package last updated on 10 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc