Created
August 12, 2016 16:03
-
-
Save br2490/cd8a34a0f4af171ef562d0d9931e69df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import time | |
fgs_url = 'http://islandora:8080/fedoragsearch/rest' | |
user = 'fedoraAdmin' | |
password = 'XXXXX' | |
fgs_session = requests.Session() | |
fgs_session.auth = (user, password) | |
# UPDATED BCRW PIDS FROM 0 to 1522 INCLUSIVE | |
pid_start = 0 | |
pid_end = 1522 | |
pid_current = 0 | |
while (pid_current <= pid_end): | |
print('Updating pid: ' + str(pid_current)) | |
time.sleep(.5) | |
data = { | |
'operation': 'updateIndex', | |
'action': 'fromPid', | |
'value': 'bcrw:' + str(pid_current) | |
} | |
response = fgs_session.post(fgs_url, data=data) | |
print(response.status_code) | |
pid_current += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ben - the response page has more details on failure and/or success ~ parse it maybe?