chrispooledotcom

Send reddit Saved Links to Pinboard

01 August 2011

This is a simple python1 script to send saved links from reddit to Pinboard. They get added to your unread pile. It may be useful if reddit ever goes down.

Usage

Download the script here.

Go to your reddit preferences, and under content options, tick enable private RSS feeds. Then visit your private RSS feeds page and grab the link for the RSS feed for your saved links2.

Use the RSS feed link when calling the script from the shell:

reddit_save_to_pinboard [-t] (saved links feed url) (pinboard username)
                             [pinboard password]

If no password is given, it’ll ask you for it. For example, here’s what I type in:

reddit_save_to_pinboard "http://www.reddit.com/saved.rss?feed=deadbeef18284e0c2c421&user=chrispoole" chrispoole mypinboardpassword

Further information

Each link is given two tags: reddit, and that link’s subreddit name.

By default, the Pinboard link is the submitted URL, with a link to the reddit comments page as the Pinboard comment.

Screenshot of the output in pinboard

If you like to use the reddit toolbar, use the -t option, which sets the toolbar link as the main Pinboard link, and adds the submitted URL in the comments. If you want to retain the usual behaviour of this script but still use the reddit toolbar for regular browsing, just don’t add the -t option.

Dependencies

You’ll need three modules that don’t come with Python by default:

BeautifulSoup3 and FeedParser are available on pypi, using pip. If you’re getting the error ImportError: pinboard module required., put the file pinboard.py (from the Python-Pinboard page) in the same directory as this script.

Change log

20111118
Major refactor, fixing a reddit toolbar issue on the way.
20111111
Reverse reddit feed entries so they match order shown on Pinboard.
  1. Python comes as standard on Mac OS X, and many popular distributions of GNU/Linux.

  2. If you’re getting BeautifulSoup import errors, use the latest stable release: pip install BeautifulSoup==3.2.0.