diff --git a/add_number.py b/add_number.py new file mode 100755 index 0000000..13a9977 --- /dev/null +++ b/add_number.py @@ -0,0 +1,19 @@ +#!/usr/bin/python3 + +import ox.api + +api = ox.api.signin('https://amp.0x2620.org/api/') + +n = 1 +for item in api.find({ + 'condtions': [{'key': 'title', 'value': 'cnv', '^'}], + 'keys': ['id', 'title'], + 'sort': [{'key': 'created', 'order': '+'}], + 'range': [0, 10000] +})['data']['items']: + api.edit({ + 'id': item['id'], + 'title': '%s %s' % (n, item['title']), + }) + n += 1 +