Linux

Stream a Reddit thread’s comments into a terminal window

Whenever I watch a football or hocky game I like to pull up the Reddit threads that are discussing them to see people’s reactions. I was a pain to refresh the screen and it would be so much better if you could see the comments streaming in real time. I came up with this little script using node and you can have it running in just a few minutes.reddistream2

To invoke it you just run

reddistream <URL of comments>

Thats it. The page updates every five seconds with the newest comments at the bottom.

To install Reddistream first install the Node package manager however its done on your system. That will bring in NodeJS as a dependency. Then you just need to install Reddistream:

sudo npm install reddistream -g

Now open up some Reddit comments and run Reddistream followed by the URL and watch the comments flow in.

Heres the github: https://github.com/agronick/reddistream
and
The NPM link: https://www.npmjs.org/package/reddistream

This lets you do lots of coll stuff because its in a terminal window. You can monitor for activity. You can pipe to other commands and you can redirect your output to a file.

Edit: So I added some new features.

  • It now clearly says who replied to a comment.
  • Comments are indented based off how many parent comments they have
  • Quotes are now italic
  • You can turn off these features by putting -r to disable showing who replied to a post and -i to disable indenting comments.
Advertisements

2 thoughts on “Stream a Reddit thread’s comments into a terminal window

  1. I like this. Would it be alot of trouble to create something like a “Watch subreddit” with instead of comments, new threads that have been made?

    1. Yeah that shouldn’t be too hard to make. There are a some things that do that already but none in a terminal I believe. Each line would need to be a link because the text is pretty useless by itself.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s