Commit b1c967ed authored by Norris Hua's avatar Norris Hua
Browse files
parents 47882f3c cc547123
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ def newConfig():
    username=input('Username: ')
    passwd=input('Password: ')
    f=open('config.json','w')
    config={"username": username, "password": passwd, "testUrl": "http://g.cn", "interval_retry_connection": "20", "interval_retry_login": "10", "interval_check_status": "300"}
    config={"username": username, "password": passwd, "testUrl": "http://www.v2ex.com/generate_204", "interval_retry_connection": "20", "interval_retry_login": "10", "interval_check_status": "300"}
    f.write(json.dumps(config))
    f.close()
    printWithTimeStamp('Configurations successfully saved.')    
@@ -50,8 +50,7 @@ def loadConfig():
        return newConfig()

def ifLoggedIn(test):
    if test.text.find(r'Central Authentication Service') == -1:
    #The login page of CAS will contain these words
    if test.status_code==204:
        return True
    return False
  

README.md

0 → 100644
+15 −0
Original line number Diff line number Diff line
# CAS_Auto_Login
SUSTC network account auto login
## Requirements
requests 2.10.0
### Installation
    pip install requests
## Configuration items
'username': Your SUSTC studnet ID   
'password': CAS login password  
'interval_retry_connection': In second. If the status check failed (e.g. the server was down or there is no Internet connection), how long the program will wait before next attempt. Default value is 20.  
'interval_check_status':  In second. Determine how long the program will wait before next status check. Default value is 300.  
'interval_retry_login':  In second. If the login failed (e.g. wrong username & password combination, or the CAS server was down), how long the program will wait before next attempt. Default value is 10.  
## Contacts
If there are any questions, please reach me on Telegram.   
[@NorrisHua](https://www.telegram.me/NorrisHua)