Skip to content

Commit d8c996d

Browse files
authored
Merge pull request #107 from Zohair-coder/dev
Dev
2 parents 71824d1 + d7611f2 commit d8c996d

File tree

6 files changed

+448
-631
lines changed

6 files changed

+448
-631
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pip install -r requirements.txt
2727

2828
## Usage
2929

30-
To run the scraper, simply run:
30+
First, [set up authentication](#Authentication).
31+
Then, to run the scraper, simply run:
3132

3233
###### Mac/Linux
3334
```bash
@@ -43,6 +44,36 @@ The scraper will output a JSON file called `data.json` in the same directory as
4344

4445
You can modify the scraper to scrape other terms by changing the `year`, `quarter`, and `college_code` variables in `src/config.py`.
4546

47+
#### Authentication
48+
49+
Since the term master schedule is only accessible to logged-in Drexel students, to run the scraper, you will need to provide your Drexel credentials as well as provide multi-factor authentication (MFA).
50+
51+
To provide your Drexel credentials, set the environment variable `DREXEL_USERNAME` to your Drexel username (abc123) and `DREXEL_PASSWORD` to the password you use to login to Drexel One. You can follow [this](https://phoenixnap.com/kb/windows-set-environment-variable) guide for Windows, and [this](https://phoenixnap.com/kb/set-environment-variable-mac) guide for MacOS to set environment variables.
52+
53+
There are two ways to provide MFA for the script to authenticate with. The first is easier if you're looking to run the script manually and quickly. The second is better if you are going to be running the script frequently, or if it needs to be automated.
54+
55+
###### Authenticate manually
56+
57+
You will authenticate the scraper manually as if you were logging into Drexel One, using a one-time code either from an authenticator app or that is texted to you. After setting the `DREXEL_USERNAME` and `DREXEL_PASSWORD` environment variables, run the scraper as explained [above](#Usage), and you will be prompted for your verification code.
58+
59+
###### Authenticate using a secret key
60+
61+
If you set this up, you will not need to manually enter an authentication code each time you run the scraper.
62+
63+
1. Go to [connect.drexel.edu](connect.drexel.edu).
64+
2. Click 'Help & Settings', then 'Change MFA settings'.
65+
3. Log in to the Microsoft portal, then click 'Add sign-in method' on the 'Security info' tab.
66+
4. Select 'Authenticator app' for the method, and click 'Add'.
67+
5. Select 'I want to use a different authenticator app', and then 'Next'.
68+
6. Select 'Can't scan image?' when prompted with a QR code, and you should see an Account name and Secret key.
69+
7. Set your `DREXEL_MFA_SECRET_KEY` environment variable to the given Secret key.
70+
8. Select 'Next', you should be prompted to enter an authentication code.
71+
9. With the secret key environment variable set, run `python3 src/totp.py` which will generate a one-time code.
72+
10. Enter this code into the Microsoft website, and select 'Next'
73+
11. 'Authenticator app' with TOTP should have been added to the list of available methods.
74+
75+
Now, when you run the scraper as explained [above](#Usage), it should authenticate itself automatically using this secret key.
76+
4677
#### All Colleges
4778

4879
To scrape all colleges instead of just the one specified in the `src/config.py`, run the following command:

0 commit comments

Comments
 (0)