|
| 1 | +# Export Saved Reddit Posts |
| 2 | + |
| 3 | +Exports saved and/or upvoted Reddit posts into a HTML file that is ready to be imported into Google Chrome. Sorts items into folders by subreddit. |
| 4 | + |
| 5 | +## Requirements |
| 6 | +* [Python 3.x](https://www.python.org/downloads/) |
| 7 | +* [pip](https://pip.pypa.io/en/stable/installing/) |
| 8 | +* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (recommended) |
| 9 | + |
| 10 | +## Installation |
| 11 | + |
| 12 | +First, make sure you have [Python 3.x](https://www.python.org/downloads/), [pip](https://pip.pypa.io/en/stable/installing/), and [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed on your machine. |
| 13 | + |
| 14 | +Run the following in your command prompt to install: |
| 15 | + |
| 16 | + git clone https://github.com/csu/export-saved-reddit.git |
| 17 | + cd export-saved-reddit |
| 18 | + pip install -r requirements.txt |
| 19 | + |
| 20 | +To install without git, [download the source code from GitHub](https://github.com/csu/export-saved-reddit/archive/master.zip), extract the archive, and follow the steps above beginning from the second line. |
| 21 | + |
| 22 | +## Usage |
| 23 | +1. [Make a new Reddit](https://www.reddit.com/prefs/apps) app to get a `client id` and a `client secret`. |
| 24 | + |
| 25 | + - Scroll to the bottom of the page and click "create app" |
| 26 | + - You can name the app anything (e.g. "export-saved"). Select the "script" option. Put anything for the redirect URI (e.g. https://christopher.su). |
| 27 | + - After creating the app, the client id will appear under the app name while the client secret will be labeled "secret". |
| 28 | + |
| 29 | +2. In the `export-saved-reddit` folder, rename the `AccountDetails.py.example` file to `AccountDetails.py`. |
| 30 | +3. Open the `AccountDetails.py` in a text editor and enter your Reddit username, password, client id, client secret within the corresponding quotation marks. Save and close the file. |
| 31 | +4. Back in your shell, run `python export_saved.py` in the `export-saved-reddit` folder. This will run the export, which will create `chrome-bookmarks.html` and `export-saved.csv` files containing your data in the same folder. |
| 32 | + |
| 33 | +### Additional Options |
| 34 | + |
| 35 | +[[[cog |
| 36 | + import subprocess |
| 37 | + import cogapp as cog |
| 38 | + |
| 39 | + def indent(text, width=4): |
| 40 | + return "\n".join((" "*width + line) for line in text.splitlines()) |
| 41 | + |
| 42 | + text = subprocess.check_output("python ./export_saved.py --help", shell=True) |
| 43 | + cog_obj = cog.Cog() |
| 44 | + cog_obj.prout(indent(text.decode('utf8'))) |
| 45 | +]]] |
| 46 | +[[[end]]] |
| 47 | + |
| 48 | +## Updating |
| 49 | +To update the script to the latest version, enter the `export-saved-reddit` folder in your shell/command prompt and enter the following: |
| 50 | + |
| 51 | + git pull |
| 52 | + |
| 53 | +## Help |
| 54 | +If you have any questions or comments, please [open an issue on GitHub](https://github.com/csu/export-saved-reddit/issues) or [contact me](https://christopher.su/about/). |
| 55 | + |
| 56 | +## [Contributing](https://github.com/csu/export-saved-reddit/blob/master/CONTRIBUTORS.md) |
| 57 | +[](https://travis-ci.org/csu/export-saved-reddit) |
| 58 | + |
| 59 | +If you would like to contribute, check out the project's [open issues](https://github.com/csu/export-saved-reddit/issues). [Pull requests](https://github.com/csu/export-saved-reddit/pulls) are welcome. |
0 commit comments