Home > python > Browse your favorite subreddits painlessly

Browse your favorite subreddits painlessly


You visit your favorite subreddit and you notice that it’s full of new posts. If you want to check them all, you need to click on each post. How to open all these posts in new tabs?


I made a little Python script for solving this problem (available here, in the folder “reddit”). Just specify a subreddit and what to extract (comment links [-c switch] or direct URLs [-u switch]). The script will list the available links. With another script of mine you can open these links in Firefox.

Basic usage

./reddit_get_posts.py -c /r/earthporn

Get links to comments of subreddit “earthporn”.

./reddit_get_posts.py -u /r/earthporn

Get links to direct URLs of subreddit “earthporn”.

./reddit_get_posts.py -u http://www.reddit.com/r/earthporn

You can specify the complete URL of the subreddit.

./reddit_get_posts.py -u http://www.reddit.com/r/EarthPorn/?count=25&after=t3_jffyd

You can even browse pages on reddit.com.

./reddit_get_posts.py -u

Extract links of your favourite subreddit (specify it with the constant DEFAULT_REDDIT).

Advanced usage

This script can be used together with another script of mine called open_in_tabs.py, which
is part of this Bash-Utils project too. open_in_tabs.py can open the extracted links in
your Firefox instance. Example:

./reddit_get_posts.py -u /r/earthporn | open_in_tabs -s

This will open the links simultaneously (-s switch) in Firefox.

Categories: python Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: