Skip to content

Commit cd5292e

Browse files
committedMar 1, 2017
new: dev: use template to generate help section on readme.
after install cogapp, just run this command to generate readme file. ```python -m cogapp -d ./README.md.tmpl > ./README.md```
1 parent a61e6a7 commit cd5292e

File tree

3 files changed

+68
-6
lines changed

3 files changed

+68
-6
lines changed
 

‎README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Export Saved Reddit Posts
2+
23
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.
34

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

910
## Installation
11+
1012
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.
1113

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

3133
### Additional Options
3234

33-
usage: export_saved.py [-h] [-u USERNAME] [-p PASSWORD] [-v] [-up]
34-
35-
Exports saved Reddit posts into a HTML filethat is ready to be imported into
35+
usage: export_saved.py [-h] [-u USERNAME] [-p PASSWORD] [-id CLIENT_ID]
36+
[-s CLIENT_SECRET] [-v] [-up]
37+
38+
Exports saved Reddit posts into a HTML file that is ready to be imported into
3639
Google Chrome
37-
40+
3841
optional arguments:
3942
-h, --help show this help message and exit
4043
-u USERNAME, --username USERNAME
@@ -48,7 +51,6 @@ To install without git, [download the source code from GitHub](https://github.co
4851
-v, --verbose increase output verbosity
4952
-up, --upvoted get upvoted posts instead of saved posts
5053

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

‎README.md.tmpl

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
[![Build Status](https://travis-ci.org/csu/export-saved-reddit.svg?branch=master)](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.

‎requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
pytest==3.0.6
33
pytest-cov==2.4.0
44
flake8==3.3.0
5+
cogapp==2.5.1

0 commit comments

Comments
 (0)