Skip to content

Commit

Permalink
Limited the number of posts show at start of stream command
Browse files Browse the repository at this point in the history
  • Loading branch information
dfireBird committed Jan 5, 2020
1 parent 7581b6b commit 758fc86
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/livestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ const Reddit = require('./Reddit');
const {SubmissionStream} = require('snoostorm');

const livestream = (name) => {
const submissions = new SubmissionStream(Reddit, {subreddit: name, pollTime: 1000});
const submissions = new SubmissionStream(Reddit, {subreddit: name, limit: 10, pollTime: 1000});
submissions.on('item', (submission) => {
console.log('\x1b[32m%s\x1b[0m', submission.title);
});
}

livestream('memes');

module.exports = livestream;

0 comments on commit 758fc86

Please sign in to comment.