Skip to content

Commit b9ad8b0

Browse files
committed
Readme: add more thorough instructions and limit text width to 80 chars
1 parent 1b02f0e commit b9ad8b0

File tree

1 file changed

+69
-15
lines changed

1 file changed

+69
-15
lines changed

README.md

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,72 @@
11
# StackExchangeBackupLaravel
2-
Allows you to export JSON files of your most important data (questions, answers, comments, favorites) from each of your Stack Exchange sites (Stack Overflow, Super User, Server Fault, etc).
2+
3+
Allows you to export JSON files of your most important data (questions,
4+
answers, comments, favorites) from each of your Stack Exchange sites (Stack
5+
Overflow, Super User, Server Fault, etc).
36

47
## Installation
58

6-
1. I think this project requires PHP 7.3 or later, so be sure that your system complies.
7-
1. Sign up at https://stackapps.com/apps/oauth/register to receive a Client ID, Client Secret, and Key. (It's free, easy, and fast.)
8-
1. Create a Laravel project, and make sure that it works: https://laravel.com/docs/5.8/installation#installing-laravel
9-
1. Add this package into your Laravel project: `vagrant@vboxHomestead:~/Code/MyLaravelProject$ composer require ryancwalsh/stack-exchange-backup-laravel:dev-master --prefer-source`
10-
1. Run `php artisan vendor:publish`, and if it gives you a choice, choose to publish from this package.
11-
1. Edit your Laravel project's `.env` file to have your own StackApps values. A non-working sample is below.
12-
1. Run `php artisan exportStackExchange`. (Note that `php artisan exportStackExchange --flushCache` is an available option to clear the cached access code value.)
13-
1. Following the instructions in the terminal, you'll use your browser to visit a URL that will provide you with a temporary access token to paste into the terminal.
14-
1. Finished! The JSON files will appear in your `/storage/app/StackExchange` folder.
9+
There is no need to clone this repository, the installation works with _PHP
10+
composer_. It will install the _Laravel_ framework and add this project to the
11+
app.
12+
13+
1. This is only tested on PHP 7.3, so be sure that your system complies.
14+
15+
1. Sign up at https://stackapps.com/apps/oauth/register to receive a Client
16+
ID, Client Secret, and Key (it's free, easy, and fast). Note: use
17+
`stackexchange.com` for `OAuth Domain` in the setup.
18+
19+
1. Create a [Laravel project](https://laravel.com/docs/5.8/installation#installing-laravel)
20+
for this app, and make sure that it works:
21+
22+
mkdir ~/Code/Laravel
23+
cd ~/Code/Laravel
24+
composer global require laravel/installer
25+
# on Ubuntu 18.04 and Debian 9+:
26+
echo 'export PATH="$PATH:$HOME/.config/composer/vendor/bin"' >> ~/.bashrc
27+
# on other systems this might be
28+
# echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
29+
# apply PATH:
30+
source ~/.bashrc
31+
# create the laravel project for this app:
32+
laravel new webapp
33+
34+
1. Add this package into your Laravel project in the parent folder of the app
35+
folder:
36+
37+
cd webapp/
38+
composer require ryancwalsh/stack-exchange-backup-laravel:dev-master --prefer-source
39+
40+
1. Run _artisan_, and choose to publish the "Provider" from this package:
41+
`ryancwalsh\StackExchangeBackupLaravel\ExportStackExchangeServiceProvider`
42+
43+
php artisan vendor:publish
44+
45+
1. Edit your Laravel project's `.env` file to have your own StackApps values. A
46+
non-working sample is below.
47+
48+
1. Run
49+
50+
php artisan exportStackExchange
51+
52+
(Note that `php artisan exportStackExchange --flushCache` is the option to
53+
clear the cached access codevalue.)
54+
55+
1. Following the instructions in the terminal, you'll use your browser to visit
56+
a URL that will provide you with a temporary access token to paste into the
57+
terminal.
58+
(Note: you'll find the token in the `code` part of the URL of the
59+
page showing "Authorizing Application" like
60+
`https://stackexchange.com/oauth/login_success?code=TLBxyz...`)
61+
62+
1. Finished! The JSON files will appear in your `/storage/app/StackExchange`
63+
folder.
1564

1665
```
1766
# These are sample .env values:
18-
STACKAPPS_CLIENT_ID=12227
19-
STACKAPPS_CLIENT_SECRET=ydxGSDFHDF4DtZqCesr)yJIw((
20-
STACKAPPS_KEY=JuWsTgfG2CqjdghkhdgBkQ((
67+
STACKAPPS_CLIENT_ID=<your Client Id>
68+
STACKAPPS_CLIENT_SECRET=<your Client Secret>
69+
STACKAPPS_KEY=<your Key>
2170
AWS_ACCESS_KEY_ID=AKIAmb3mbn56mn6
2271
AWS_SECRET_ACCESS_KEY=jl234k5jl23k45j23lj5
2372
AWS_DEFAULT_REGION=us-east-1
@@ -27,12 +76,17 @@ AWS_BUCKET=xyz
2776

2877

2978
## If You Use This Package, Let Me Know!
30-
**This is the first package that I've ever made, and I'm super curious if anyone will ever use it. If you do try it out, I'd love for you to [open an issue](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/issues/new) to say hi** (and of course to tell me any suggestions you have).
79+
**This is the first package that I've ever made, and I'm super curious if anyone
80+
will ever use it. If you do try it out, I'd love for you to [open an
81+
issue](https://github.com/ryancwalsh/StackExchangeBackupLaravelPHP/issues/new)
82+
to say hi** (and of course to tell me any suggestions you have).
3183

3284
___
3385

3486
### If You Want To Get Creative...
35-
Visit https://api.stackexchange.com/docs to read the docs, and you can modify `ExportStackExchangeHelper.php` to do whatever you want. The Stack Exchange API is great.
87+
Visit https://api.stackexchange.com/docs to read the docs, and you can modify
88+
`ExportStackExchangeHelper.php` to do whatever you want. The Stack Exchange API
89+
is great.
3690

3791

3892

0 commit comments

Comments
 (0)