Skip to content

Instantly share code, notes, and snippets.

@br2490
Created August 12, 2016 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save br2490/cd8a34a0f4af171ef562d0d9931e69df to your computer and use it in GitHub Desktop.
Save br2490/cd8a34a0f4af171ef562d0d9931e69df to your computer and use it in GitHub Desktop.
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
@br2490
Copy link
Author

br2490 commented Aug 15, 2016

Ben - the response page has more details on failure and/or success ~ parse it maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment