|
37 | 37 | userFullName = status['fullname'] |
38 | 38 | print 'authenticated' |
39 | 39 |
|
40 | | -# endpoint = baseURL+'/rest/communities' |
41 | | -# communities = requests.get(endpoint, headers=header, cookies=cookies, verify=verify).json() |
42 | | - |
43 | | -#create list of all item IDs |
44 | | -#itemList = [] |
45 | | -# f=csv.writer(open(filePath+'collectionStats.csv', 'wb')) |
46 | | -# f.writerow(['Name']+['collectionID']+['collectionHandle']+['numberOfItems']) |
47 | | -# for i in range (0, len (communities)): |
48 | | -# communityID = communities[i]['uuid'] |
49 | | -# communityName = communities[i]['name'].encode('utf-8') |
50 | | -# collections = requests.get(baseURL+'/rest/communities/'+str(communityID)+'/collections', headers=header, cookies=cookies, verify=verify).json() |
51 | | - # for j in range (0, len (collections)): |
52 | | - # collectionID = collections[j]['uuid'] |
53 | | - # numberItems = collections[j]['numberItems'] |
54 | | - # collectionName = collections[j]['name'].encode('utf-8') |
55 | | - # collectionHandle = collections[j]['handle'] |
56 | | - # fullName = communityName+' - '+collectionName |
57 | | - # if collectionID == '4dccec82-4cfb-4583-a728-2cb823b15ef0': |
58 | | - # print 'Levy Collection - skipped' |
59 | | - # else: |
60 | | - # f.writerow([fullName]+[collectionID]+[collectionHandle]+[str(numberItems).zfill(6)]) |
61 | | - # items = requests.get(baseURL+'/rest/collections/'+str(collectionID)+'/items?limit=5000', headers=header, cookies=cookies, verify=verify) |
62 | | - # while items.status_code != 200: |
63 | | - # time.sleep(5) |
64 | | - # print 'collection:', collectionID, '# of items:',len(items), 'fail' |
65 | | - # items = requests.get(baseURL+'/rest/collections/'+str(collectionID)+'/items?limit=5000', headers=header, cookies=cookies, verify=verify) |
66 | | - # items = items.json() |
67 | | - # print 'collection:', collectionID,', Number of items:',len(items) |
68 | | - # for i in range (0, len (items)): |
69 | | - # itemID = items[i]['uuid'] |
70 | | - # concat = str(communityID)+':'+str(collectionID)+'|'+str(itemID) |
71 | | - # itemList.append(concat) |
72 | | - |
73 | 40 | f=csv.writer(open(filePath+'collectionStats.csv', 'wb')) |
74 | 41 | f.writerow(['Name']+['collectionID']+['collectionHandle']+['numberOfItems']) |
75 | 42 |
|
|
105 | 72 | offset = offset + 200 |
106 | 73 | print offset |
107 | 74 |
|
108 | | - |
109 | 75 | elapsedTime = time.time() - startTime |
110 | 76 | m, s = divmod(elapsedTime, 60) |
111 | 77 | h, m = divmod(m, 60) |
|
0 commit comments