mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Update notes for 2019-04-15
This commit is contained in:
@ -649,5 +649,30 @@ GC_TUNE="-XX:NewRatio=3 \
|
||||
|
||||
- Rework the dspace-statistics-api to use the vanilla Python requests library instead of Solr client
|
||||
- [Tag version 1.0.0](https://github.com/ilri/dspace-statistics-api/releases/tag/v1.0.0) and deploy it on DSpace Test
|
||||
- Pretty annoying to see CGSpace (linode18) with 20–50% CPU steal according to `iostat 1 10`, though I haven't had any Linode alerts in a few days
|
||||
- Abenet sent me a list of ILRI items that don't have CRPs added to them
|
||||
- The spreadsheet only had Handles (no IDs), so I'm experimenting with using Python in OpenRefine to get the IDs
|
||||
- I cloned the handle column and then did a transform to get the IDs from the CGSpace REST API:
|
||||
|
||||
```
|
||||
import json
|
||||
import re
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
handle = re.findall('[0-9]+/[0-9]+', value)
|
||||
|
||||
url = 'https://cgspace.cgiar.org/rest/handle/' + handle[0]
|
||||
req = urllib2.Request(url)
|
||||
req.add_header('User-agent', 'Alan Python bot')
|
||||
res = urllib2.urlopen(req)
|
||||
data = json.load(res)
|
||||
item_id = data['id']
|
||||
|
||||
return item_id
|
||||
```
|
||||
|
||||
- Luckily none of the items already had CRPs, so I didn't have to worry about them getting removed
|
||||
- It would have been much trickier if I had to get the CRPs for the items first, then add the CRPs...
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user