Created
February 6, 2019 19:36
-
-
Save ad-m/b4a92837e99f1ca20d98ff30f7885562 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import usosapi | |
| logging.basicConfig(level=logging.DEBUG) | |
| log = logging.getLogger('USOSAPI') | |
| log.setLevel(logging.DEBUG) | |
| # usosapi.SCOPES = 'photo' | |
| conn = usosapi.USOSAPIConnection( | |
| api_base_address='https://apps.uph.edu.pl/', | |
| consumer_key='....', | |
| consumer_secret='...' | |
| ) | |
| print(conn.get_authorization_url()) | |
| conn.authorize_with_pin(input('Enter PIN')) | |
| # conn.set_access_data( | |
| # *('....', '...')) | |
| # pprint(conn.current_identity()) | |
| # pprint(conn.get('/services/apiref/method_index')) | |
| # pprint(conn.get('/services/apisrv/installation')) | |
| # pprint([x['institution_name']['pl'] for x in conn.get('services/apisrv/installations')]) | |
| # conn.get('services/credits/used_sum') | |
| # print(conn.get('services/photos/my_photo_visibility')) | |
| # print(dir(conn.get('services/photos/photo'))) | |
| print(conn.get('services/users/user', fields='student_status')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment