GithubHelp home page GithubHelp logo

cattte / reddit-migrate Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 1.0 233 KB

A command-line tool to migrate, export, import, and purge reddit account data!

License: MIT License

JavaScript 11.77% TypeScript 88.23%
reddit migrate export import data

reddit-migrate's Introduction

reddit-migrate

A command-line tool to migrate, export, import, and purge reddit account data!

Demo

It migrates/exports/imports subscribed subreddits, followed users, friends, blocked users, multireddits, profile settings, and account preferences. It can also purge (mass-delete) your comments and submissions.

Installation

npm i -g cAttte/reddit-migrate

Usage

reddit-migrate [command] [options]

Commands

help

Display command help.

migrate

Migrate to a new reddit account.

Options:

  • -e <path>, --env-file <path>: Path of the .env file to load credentials from.
  • -? <list>, --which <list>: A comma-separated list of attributes to migrate, or 'all'.

import

Import data to a reddit account.

Options:

  • -e <path>, --env-file <path>: Path of the .env file to load credentials from.
  • -i <path>, --input <path>: Path of the input file. (required)
  • -? <list>, --which <list>: A comma-separated list of attributes to import, or 'all'.

export

Export data from a reddit account.

Options:

  • -e <path>, --env-file <path>: Path of the .env file to load credentials from.
  • -o <path>, --output <path>: Path of the output file. (required)
  • -p, --pretty: Whether to prettify the output JSON.
  • -w, --overwrite: Avoid the 'overwrite?' prompt if file already exists.
  • -? <list>, --which <list>: A comma-separated list of attributes to export, or 'all'.

purge

Mass-delete reddit account content.

Options:

  • -e <path>, --env-file <path>: Path of the .env file to load credentials from.
  • -d <text>, --edit <text>: Text to edit messages and posts to before deleting.
  • -? <type>, --which <type>: Submission type to delete; 'posts', 'comments', or 'all'.

Credentials

As seen in the command options, you can pass the path/filename of a .env file, containing the credentials of the reddit account(s). However, if it's not provided (or the credentials are not included in the file), the CLI will prompt you to enter them:

Check out example.env to find out how the file should look for each command.

Obtaining CLIENT_ID and CLIENT_SECRET

  • Head over to the Apps section of your reddit account preferences.
  • Click on the create app button.
  • Type whatever in the name and redirect URI fields. Make sure to select the script app type.
  • Your client ID will be shown below the app name and type. The secret, next to the other app info.

License

This project uses the MIT License. Check it out for more info.

TODO

  • Migrate/import profile picture and banner; these are not imported correctly with the URLs.
  • Add an option to specify which data should be imported/exported/migrated.
  • Add a feature to "clear" data; unsubscribe from all subreddits, unfollow everyone, etc.
  • Add a feature to mass delete comments and posts, optionally editing them before.
  • Move to a reddit API wrapper that doesn't suck ass (ie, not snoowrap).

reddit-migrate's People

Contributors

brownpl avatar cattte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

brownpl

reddit-migrate's Issues

error is not a function

When trying to export, I'm running into the following issue:

$> reddit-migrate export -e example.env --output /tmp/export.json

Thanks for looking โœŒ๏ธ

Rate limit handling

hi @cAttte

Thanks for the tool! I just tested and unfortunately, it doesn't seem to handle rate limiting:

Unexpected Error: snoowrap refused to continue because reddit's ratelimit was exceeded. For more information about reddit's ratelimit, please consult reddit's API rules at https://github.com/reddit/reddit/wiki/API.

Do you have any plans to support it?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.