30 lines
634 B
Python
Executable file
30 lines
634 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import getpass
|
|
import json
|
|
import sys
|
|
|
|
import ox
|
|
import ox.api
|
|
|
|
site = 'pandora.cinemusespace.com'
|
|
api = ox.api.signin('https://%s/api/' % site)
|
|
|
|
keywords = set()
|
|
for annotation in api.findAnnotations({
|
|
'query': {
|
|
'conditions': [{
|
|
'key': 'layer',
|
|
'value': 'keywords',
|
|
'operator': '=='
|
|
}],
|
|
'operator': '&'
|
|
},
|
|
'keys': ['id', 'in', 'out', 'value', 'user', 'created'],
|
|
'range': [0, 500000]
|
|
})['data']['items']:
|
|
keywords.add(annotation['value'])
|
|
|
|
|
|
with open('keywords.json', 'w') as fd:
|
|
json.dump(list(sorted(keywords)), fd, indent=4)
|