Go to file
DebaucheryLibrarian 591d0054b3 Added limit and sort parameters, post index variable and relevant usage documentation. 2024-09-11 05:16:53 +02:00
methods Added support for i.redd.it and self posts. Moved pattern interpolation out of fetch module. 2024-09-11 05:16:53 +02:00
.gitignore Fetching posts in series to prevent directory creation race condition. Removed duplicate check for now (will check per post, not per image, in the future). 2024-09-11 05:16:53 +02:00
README.md Added limit and sort parameters, post index variable and relevant usage documentation. 2024-09-11 05:16:53 +02:00
app.js Added limit and sort parameters, post index variable and relevant usage documentation. 2024-09-11 05:16:53 +02:00
dissectLink.js Added support for i.redd.it and self posts. Moved pattern interpolation out of fetch module. 2024-09-11 05:16:53 +02:00
fetchContent.js Added limit and sort parameters, post index variable and relevant usage documentation. 2024-09-11 05:16:53 +02:00
interpolate.js Added limit and sort parameters, post index variable and relevant usage documentation. 2024-09-11 05:16:53 +02:00
package-lock.json 0.5.0 2024-09-11 05:16:53 +02:00
package.json 0.5.0 2024-09-11 05:16:53 +02:00

README.md

reddit-post-dump

Installation

npm install

Usage

node app.js --user={username}

Optional parameters

  • --limit={number}: Maximum amount posts to fetch content from
  • --sort={method}: How posts should be sorted while fetched. This affects the $postIndex variable, and in combination with a --limit decides what posts will be included

Configuration

The default configuration aims to be sensible, and the application may be used without any further tweaking. However, this application came to life because I was not satisfied by the organizatory facilities of similar applications, thus a multitude of options are at your disposal as described in this document.

Patterns

Path patterns dictate where and how a file will be saved. Various variables and options are available, and you may use subdirectories divided by /.

Variables

  • $postId: The ID of the reddit post
  • $postTitle: The title of the reddit post
  • $postUser: The user that submitted the post, almost always equivalent to the --user command line argument
  • $postDate: The submission date of the reddit post, formatted by the dateformat configuration described below
  • $postIndex: The index of the post according to the sort method
  • $albumId: The ID of the media host album
  • $albumTitle: The title of the media host album
  • $albumDescription: The description of the media host album
  • $albumDate: The submission date of the media host album, formatted by the dateformat configuration described below
  • $itemId: The ID of the individual image or video
  • $itemTitle: The title of the individual image or video
  • $itemDescription: The description of the individual image or video
  • $itemDate: The submission date of the individual image or video, formatted by the dateformat configuration described below
  • $itemIndex: The index of the individual image or video in an album, offset by the indexOffset configuration described below
  • $ext: The extension of the file. Must typically be included, but may be omitted for self (text) posts on Unix systems

Date format

Affects the representation of $postDate, $albumDate and $itemDate and defaults to YYYYMMDD. See this documentation for an overview of all available tokens.

Index offset

Arrays start at 0, but as to not tire myself out debating the matter, you may offset it my any numerical value you like. Affects the $itemIndex variable for album items.

Slash substitute

The patterns represent Unix file paths, and a / therefore indicates a new directory. You may freely use directories in your paths, but titles or descriptions may contain a / that is not supposed to create a new directory. All instances of / in a variable value will be replaced with the configured slash substitute.