UPDATE: This doesn't work after the recent makeover of Nalanda (they basically upgraded their moodle) in 2017
Update lecture slides with one click. Regular trips to Nalanda? Now Lite. Are you a gen BITSian? Do you download lecture slides just before your Compre/MidSem? Then Nalanda Lite is what you need. You shouldn't be wasting time downloading each and every slide, should you? So take visiting Nalanda Lite and use Nalanda Lite.
- Clone this Repository (or download a zipped version)
- Create a credentials.txt file in this folder. The first line of this file must have your username enclosed whithin two ^ characters. i.e. the first line must be ^your_Nalanda_username^ and similarly, the second line of this file must be ^your_Nalanda_password^.
- Do not worry! Your password is safe. It NEVER leaves your computer. It remains there.
- Go to the terminal and navigate to this folder ('nalandalite'). run "sudo pip install -r requirements.txt"
- Run "python nalanda.py"
- That's All!! Everytime you run nalanda.py, your lecture slides will be updated.
- A directory named COURSES will be created which will hold all your courses.
^f201xabc^
^password^
~ $ sudo pip install -r requirements.txt
nalandalite $ python nalanda.py
- PIP (Python's package manager)
- requests
- BeautifulSoup
$ pip install requests
$ pip install beautifulsoup4
$ pip install -r requirements.txt
You can give the script some arguements as per your need, for additional functionality. Arguements are given in argv format (i.e. separated by spaces) when running the nalanda.py script. Currently supported arguements:
- "users" : This will show the online users on nalanda. Note that when this arguement is given alone, slides aren't updated.
- "debug" : This will run nalanda.py in debug mode.
- "getslides" : This arguement is assumend by default if no arguement is given to the script, or the only arguement given is "debug" or "r=time". This, as the name suggests, will fetch your slides for you.
- "r=time" : this reloads the script every unit time. for example: "r=10s", "r=5m", "r=1h". s, m and h correspond to seconds, minutes and hours, repectively.
- "all" : Combination of all arguements except "debug"
nalandalite $ python nalanda.py
/* Runs Nalanda Lite normally. Slides updated */
nalandalite $ python nalanda.py debug
/* Runs Nalanda Lite in debug mode. Slides Updated */
nalandalite $ python nalanda.py users
/* Online Nalanda Users are printed. Slides not updated. (debug arguement can also be given with this) */
nalandalite $ python nalanda.py users getslides r=1h debug
/* Users Printed. Slides Updated. Recursive calls per hour. Debug Mode */
nalandalite $ python nalanda.py all r=1h debug
/* somewhat same as above */
You are free to use any part of this code, as long as you credit the Author
Chinmay Pandhare, BITS Pilani.