diff --git a/ontology/update_keywords.py b/ontology/update_keywords.py index f0a5b07..595f8d7 100755 --- a/ontology/update_keywords.py +++ b/ontology/update_keywords.py @@ -5,26 +5,10 @@ import json import sys import ox -import ox.web.auth +import ox.api site = 'pandora.cinemusespace.com' -api = ox.API('https://%s/api/' % site) -update = False -try: - credentials = ox.web.auth.get(site) -except: - credentials = {} - print('Please provide your username and password for %s:' % site) - credentials['username'] = input('Username: ') - credentials['password'] = getpass.getpass('Password: ') - update = True -r = api.signin(**credentials) -if 'errors' in r.get('data', {}): - for kv in r['data']['errors'].items(): - print('%s: %s' % kv) - sys.exit(1) -if update: - ox.web.auth.update(site, credentials) +api = ox.api.signin('https://%s/api/' % site) keywords = set() for annotation in api.findAnnotations({