How to Export Your Saved Reddit Posts into a Handy HTML File

Jun 15, 2024 | Programming

Have you ever wished to keep all your favorite Reddit posts curated neatly in a downloadable format? Look no further! This guide will take you through a straightforward process to export your saved and upvoted Reddit posts into an HTML file that’s easy to import into Google Chrome. So, let’s dive in!

Requirements

Installation

First things first, ensure you have Python, pip, and git installed on your device. Once you’re all set, follow these steps:

  1. Open your command prompt.
  2. Run the following commands:
  3. git clone https://github.com/csuexport-saved-reddit.git
    cd export-saved-reddit
    pip install -r requirements.txt
  4. If you prefer a different method, download the source code from GitHub, extract the archive, and proceed from the second command listed above.

Usage

Now that you have everything in place, it’s time to use the script!

  1. Create a new Reddit app to generate your client ID and client secret:
    • Go to Reddit App Preferences.
    • Scroll to the bottom and click “Create App”.
    • Name your app (e.g., export-saved), select the “script” option, and use any URI (like https://christopher.su).
    • After creating the app, note your client ID and client secret.
  2. In the export-saved-reddit folder, rename AccountDetails.py.example to AccountDetails.py.
  3. Open AccountDetails.py in a text editor and fill in your Reddit username, password, client ID, and client secret within the respective quotation marks. Save and close the file.
  4. Back in your shell, run:
  5. python export_saved.py
  6. This will generate chrome-bookmarks.html and export-saved.csv files with your data.

Additional Options

You can customize the export process further! Here’s a handy command you can use:

usage: export_saved.py [-h] [-u USERNAME] [-p PASSWORD] [-id CLIENT_ID]
[-s CLIENT_SECRET] [-v] [-up] [-all] [-V]

Optional arguments include:

  • -h, --help: Show help information.
  • -u USERNAME, --username USERNAME: Pass in your username as an argument.
  • -p PASSWORD, --password PASSWORD: Pass in your password as an argument.
  • -id CLIENT_ID, --client-id CLIENT_ID: Pass in your client ID as an argument.
  • -s CLIENT_SECRET, --client-secret CLIENT_SECRET: Pass in your client secret.
  • -v, --verbose: Increase output verbosity (currently deprecated).
  • -up, --upvoted: Retrieve upvoted posts instead of saved posts.
  • -all, --all: Get all (upvoted, saved, comments, and submissions).
  • -V, --version: Check the program version.

Updating Your Script

To stay updated with the latest features and fixes, navigate to the export-saved-reddit folder in your command prompt and run:

git pull

Troubleshooting

If you encounter issues during the installation or execution, here are a few troubleshooting tips:

  • Ensure you have the correct version of Python and that it’s added to your PATH.
  • If errors arise during `pip install`, verify that your internet connection is stable.
  • Double-check the values you added to AccountDetails.py for any typos.
  • Ensure that the Reddit app is set up correctly, and the client ID and secret are valid.
  • If all else fails, feel free to open an issue on GitHub.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

In Conclusion

Congratulations! You’ve now curated your Reddit treasure trove into a neat HTML file. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox