|  | ||
|---|---|---|
| methods | ||
| .gitignore | ||
| README.md | ||
| app.js | ||
| dissectLink.js | ||
| fetchContent.js | ||
| interpolate.js | ||
| package-lock.json | ||
| package.json | ||
		
			
				
				README.md
			
		
		
			
			
		
	
	reddit-post-dump
Installation
reddit-post-dump requires a arbitrarily recent version of Node.js. O
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- $postIndexvariable, and in combination with a- --limitdecides what posts will be included
Configuration
The default configuration aims to be sensible, and the application may be used without any further tweaking. However, a multitude of options are available
To change the configuration, you may edit config/default.js directly, or if you wish to preserve the defaults (recommended), create config/local.json (JSON) or config/local.js (JavaScript). This file only needs to contain the properties you wish to override, but you may wish to copy config/default.js to config/local.js for convenience.
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
Post
- $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- --usercommand line argument
- $postDate: The submission date of the reddit post, formatted by the- dateformatconfiguration described below
- $postIndex: The index of the post according to the sort method
Album
- $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- dateformatconfiguration described below
Item (individual image, video or text)
- $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- dateformatconfiguration described below
- $itemIndex: The index of the individual image or video in an album, offset by the- indexOffsetconfiguration described below
- $ext: The extension of the medium. Must typically be included, but may be omitted for self (text) posts on Unix systems
dateFormat
Affects the representation of $postDate, $albumDate and $itemDate and defaults to YYYYMMDD. See this documentation for an overview of all available tokens.
titleLength
Titles can sometimes be longer than you prefer your filenames to be, or even overflow the operating system's limit (255 bytes for Linux). This property cuts off titles at a fixed number of characters.
indexOffset
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.
slashSubstitute
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.