28 lines
501 B
Python
Executable file
28 lines
501 B
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import ox
|
|
|
|
url = 'https://'
|
|
listname = 'a:foobar'
|
|
group = 'example'
|
|
username = 'fixme'
|
|
password = 'fixme'
|
|
|
|
|
|
api = ox.API(url)
|
|
api.signin(username=username, password=password)
|
|
for item in api.find({
|
|
'query': {
|
|
'conditions': [{
|
|
'key': 'list',
|
|
'value': listname,
|
|
'operator': '=='
|
|
}]
|
|
},
|
|
'keys': ['id'],
|
|
'range': [0, 5000]
|
|
})['data']['items']:
|
|
api.edit({
|
|
'id': item['id'],
|
|
'groups': [group]
|
|
})
|