From ee38b0de9fc27a74e57628a743e75e9d80d94ad7 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 20 Feb 2019 07:42:58 -0800 Subject: [PATCH] Add notes for 2019-02-20 --- content/posts/2019-02.md | 15 +++++++++++++++ docs/2019-02/index.html | 24 +++++++++++++++++++++--- docs/robots.txt | 2 +- docs/sitemap.xml | 20 ++++++++++---------- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/content/posts/2019-02.md b/content/posts/2019-02.md index f2cf7306e..b26ec2180 100644 --- a/content/posts/2019-02.md +++ b/content/posts/2019-02.md @@ -979,4 +979,19 @@ Mozilla/5.0 (Linux; Android 7.0; TECNO Camon CX Build/NRD90M) AppleWebKit/537.36 - I wrote a quick and dirty Python script called `resolve-addresses.py` to resolve IP addresses to their owning organization's name, ASN, and country using the [IPAPI.co API](https://ipapi.co) +## 2019-02-20 + +- Ben Hack was asking about getting authors publications programmatically from CGSpace for the new ILRI website +- I told him that they should probably try to use the REST API's `find-by-metadata-field` endpoint +- The annoying thing is that you have to match the text language attribute of the field exactly, but it does work: + +``` +$ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": ""}' +$ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": null}' +$ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": "en_US"}' +``` + +- This returns six items for me, which is the [same I see in a Discovery search](https://cgspace.cgiar.org/discover?filtertype_1=orcid&filter_relational_operator_1=contains&filter_1=Alan+S.+Orth%3A+0000-0002-1735-7458&submit_apply_filter=&query=) +- Hector Tobon from CIAT asked if it was possible to get item statistics from CGSpace so I told him to use my [dspace-statistics-api](https://github.com/ilri/dspace-statistics-api) + diff --git a/docs/2019-02/index.html b/docs/2019-02/index.html index 4f5ed478a..a4d1798b7 100644 --- a/docs/2019-02/index.html +++ b/docs/2019-02/index.html @@ -42,7 +42,7 @@ sys 0m1.979s - + @@ -89,9 +89,9 @@ sys 0m1.979s "@type": "BlogPosting", "headline": "February, 2019", "url": "https://alanorth.github.io/cgspace-notes/2019-02/", - "wordCount": "5473", + "wordCount": "5628", "datePublished": "2019-02-01T21:37:30+02:00", - "dateModified": "2019-02-19T16:34:52-08:00", + "dateModified": "2019-02-20T06:29:21-08:00", "author": { "@type": "Person", "name": "Alan Orth" @@ -1266,6 +1266,24 @@ $ tidy -xml -utf8 -iq -m -w 0 dspace/config/controlled-vocabularies/cg-creator-i
  • I wrote a quick and dirty Python script called resolve-addresses.py to resolve IP addresses to their owning organization’s name, ASN, and country using the IPAPI.co API
  • +

    2019-02-20

    + + + +
    $ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": ""}'
    +$ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": null}'
    +$ curl -s -H "accept: application/json" -H "Content-Type: application/json" -X POST "https://cgspace.cgiar.org/rest/items/find-by-metadata-field" -d '{"key": "cg.creator.id","value": "Alan S. Orth: 0000-0002-1735-7458", "language": "en_US"}'
    +
    + + + diff --git a/docs/robots.txt b/docs/robots.txt index 66dc42771..d85aff9f8 100644 --- a/docs/robots.txt +++ b/docs/robots.txt @@ -44,7 +44,7 @@ Disallow: /cgspace-notes/2015-12/ Disallow: /cgspace-notes/2015-11/ Disallow: /cgspace-notes/ Disallow: /cgspace-notes/categories/ -Disallow: /cgspace-notes/tags/notes/ Disallow: /cgspace-notes/categories/notes/ +Disallow: /cgspace-notes/tags/notes/ Disallow: /cgspace-notes/posts/ Disallow: /cgspace-notes/tags/ diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 26c25e14f..634115689 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -4,7 +4,7 @@ https://alanorth.github.io/cgspace-notes/2019-02/ - 2019-02-19T16:34:52-08:00 + 2019-02-20T06:29:21-08:00 @@ -209,7 +209,7 @@ https://alanorth.github.io/cgspace-notes/ - 2019-02-19T16:34:52-08:00 + 2019-02-20T06:29:21-08:00 0 @@ -218,27 +218,27 @@ 0 - - https://alanorth.github.io/cgspace-notes/tags/notes/ - 2019-02-19T16:34:52-08:00 - 0 - - https://alanorth.github.io/cgspace-notes/categories/notes/ 2018-03-09T22:10:33+02:00 0 + + https://alanorth.github.io/cgspace-notes/tags/notes/ + 2019-02-20T06:29:21-08:00 + 0 + + https://alanorth.github.io/cgspace-notes/posts/ - 2019-02-19T16:34:52-08:00 + 2019-02-20T06:29:21-08:00 0 https://alanorth.github.io/cgspace-notes/tags/ - 2019-02-19T16:34:52-08:00 + 2019-02-20T06:29:21-08:00 0