Skip to content

Commit

Permalink
new: dev: use template to generate help section on readme.
Browse files Browse the repository at this point in the history
after install cogapp, just run this command to generate readme file.

```python -m cogapp -d ./README.md.tmpl > ./README.md```
  • Loading branch information
rachmadaniHaryono committed Mar 1, 2017
1 parent a61e6a7 commit cd5292e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Export Saved Reddit Posts

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.

## Requirements
* [Python 3.x](https://www.python.org/downloads/)
* [pip](https://pip.pypa.io/en/stable/installing/)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (recommended)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (recommended)

## Installation

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.

Run the following in your command prompt to install:
Expand All @@ -30,11 +32,12 @@ To install without git, [download the source code from GitHub](https://github.co

### Additional Options

usage: export_saved.py [-h] [-u USERNAME] [-p PASSWORD] [-v] [-up]

Exports saved Reddit posts into a HTML filethat is ready to be imported into
usage: export_saved.py [-h] [-u USERNAME] [-p PASSWORD] [-id CLIENT_ID]
[-s CLIENT_SECRET] [-v] [-up]

Exports saved Reddit posts into a HTML file that is ready to be imported into
Google Chrome

optional arguments:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
Expand All @@ -48,7 +51,6 @@ To install without git, [download the source code from GitHub](https://github.co
-v, --verbose increase output verbosity
-up, --upvoted get upvoted posts instead of saved posts


## Updating
To update the script to the latest version, enter the `export-saved-reddit` folder in your shell/command prompt and enter the following:

Expand Down
59 changes: 59 additions & 0 deletions README.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Export Saved Reddit Posts

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.

## Requirements
* [Python 3.x](https://www.python.org/downloads/)
* [pip](https://pip.pypa.io/en/stable/installing/)
* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) (recommended)

## Installation

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.

Run the following in your command prompt to install:

git clone https://github.com/csu/export-saved-reddit.git
cd export-saved-reddit
pip install -r requirements.txt

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.

## Usage
1. [Make a new Reddit](https://www.reddit.com/prefs/apps) app to get a `client id` and a `client secret`.

- Scroll to the bottom of the page and click "create app"
- 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).
- After creating the app, the client id will appear under the app name while the client secret will be labeled "secret".

2. In the `export-saved-reddit` folder, rename the `AccountDetails.py.example` file to `AccountDetails.py`.
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.
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.

### Additional Options

[[[cog
import subprocess
import cogapp as cog

def indent(text, width=4):
return "\n".join((" "*width + line) for line in text.splitlines())

text = subprocess.check_output("python ./export_saved.py --help", shell=True)
cog_obj = cog.Cog()
cog_obj.prout(indent(text.decode('utf8')))
]]]
[[[end]]]

## Updating
To update the script to the latest version, enter the `export-saved-reddit` folder in your shell/command prompt and enter the following:

git pull

## Help
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/).

## [Contributing](https://github.com/csu/export-saved-reddit/blob/master/CONTRIBUTORS.md)
[![Build Status](https://travis-ci.org/csu/export-saved-reddit.svg?branch=master)](https://travis-ci.org/csu/export-saved-reddit)

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.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
pytest==3.0.6
pytest-cov==2.4.0
flake8==3.3.0
cogapp==2.5.1

0 comments on commit cd5292e

Please sign in to comment.