We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm get this package to use with ORCID api, but I got duplicate answers where I need just one.
to replicate do this using nodejs:
const fetch = require('node-fetch'); const JSPath = require('jspath'); let doi = '0000-0002-2109-9738'; const api = "https://pub.orcid.org/v3.0"; const options = { 'method' : 'get', 'muteHttpExceptions' : true, 'headers' : { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', 'Accept': 'application/json' }; // call api let works = await fetch(api+'/'+Orcid+'/works',options).then(resp=>resp.json()); // get content direct works.group[0]['external-ids'] // output this: /* { 'external-id': [ { 'external-id-type': 'doi', 'external-id-value': '10.1007/s10530-022-02974-5', 'external-id-normalized': [Object], 'external-id-normalized-error': null, 'external-id-url': [Object], 'external-id-relationship': 'self' } ] } */ JSPath.apply('.."external-id"', works.group[0]) // output this: /* [ { 'external-id-type': 'doi', 'external-id-value': '10.1007/s10530-022-02974-5', 'external-id-normalized': { value: '10.1007/s10530-022-02974-5', transient: true }, 'external-id-normalized-error': null, 'external-id-url': { value: 'https://doi.org/10.1007/s10530-022-02974-5' }, 'external-id-relationship': 'self' }, { 'external-id-type': 'doi', 'external-id-value': '10.1007/s10530-022-02974-5', 'external-id-normalized': { value: '10.1007/s10530-022-02974-5', transient: true }, 'external-id-normalized-error': null, 'external-id-url': { value: 'https://doi.org/10.1007/s10530-022-02974-5' }, 'external-id-relationship': 'self' } ] */
The text was updated successfully, but these errors were encountered:
Hi!
I've tried this:
const doc = { 'external-ids': { 'external-id': [ { 'external-id-type': 'doi', 'external-id-value': '10.1007/s10530-022-02974-5', 'external-id-normalized': [], 'external-id-normalized-error': null, 'external-id-url': [], 'external-id-relationship': 'self' } ] } }; console.log(JSPath.apply('.."external-id"', doc));
Output is:
[ { 'external-id-type': 'doi', 'external-id-value': '10.1007/s10530-022-02974-5', 'external-id-normalized': [], 'external-id-normalized-error': null, 'external-id-url': [], 'external-id-relationship': 'self' } ]
Give me more details, I don't know what works.group[0] structure is.
works.group[0]
Sorry, something went wrong.
No branches or pull requests
I'm get this package to use with ORCID api, but I got duplicate answers where I need just one.
to replicate do this using nodejs:
The text was updated successfully, but these errors were encountered: