Automatically Download Saved Reddit Posts & Comments as Markdown Notes (into Obsidian)
- YAML Frontmatter is downloaded along with the markdown formatted note - supports using it with Dataview plugin (see below)
- Notes are saved in
reddit\<subreddit>\<note_title>
hierarchy - Clickable link to the post/comment is added at the top of the note (besides being saved in Frontmatter)
-
Go to this url and copy this link:
-
Copy settings.sample.json to settings.json and udpate these values:
jsonUrl
: Put above copied linkrootPath
: Your notes target path (use double forward slashes)overWrite
: If you wish to overwrite your existing note files with latest downloads, set this to 1
{
"jsonUrl": "https://www.reddit.com/user/erohtar/saved.json?feed=xxxxxxxxx&user=erohtar",
"rootPath": "C:\\ObsidianVault\\Reddit",
"overWrite": 0
}
-
Download (optionally portable) node.js and run redditSaver.js with it:
<path>\node\node.exe redditSaver.js
-
Done. Your notes should be created at the set path:
<vault>\Reddit\<subreddit>\<title>__<id>.md
Create a new note named redditSaver at the root of your Obsidian vault, and put this code there to get a nice table view of all your saved posts/comments:
```dataview
TABLE WITHOUT ID "[" + title + "](" + file.path + ")" AS "Title", type AS "Type", sub AS "r/"
FROM "Reddit"
SORT file.ctime DESC
```
- Reddit limits last 25 saved posts/comments in that feed
- Scheduled running of this script once daily (or so) will keep your latest saves updated automatically
- This is NOT an Obsidian plugin, and if someone wants to create one based on this idea or my code, they're more than welcome to
- To save a reddit crosspost, go to the target post and save that instead of the link post (a habit I'll have to get into myself as well)