https://github.com/orcid/orcidsearchurljs
Javascript library that builds a search URL for the ORCID public API.
https://github.com/orcid/orcidsearchurljs
Last synced: 5 months ago
JSON representation
Javascript library that builds a search URL for the ORCID public API.
- Host: GitHub
- URL: https://github.com/orcid/orcidsearchurljs
- Owner: ORCID
- License: other
- Created: 2014-09-11T17:45:15.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-05-23T12:53:21.000Z (about 10 years ago)
- Last Synced: 2025-05-12T13:53:05.757Z (about 1 year ago)
- Language: JavaScript
- Size: 1.49 MB
- Stars: 3
- Watchers: 17
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
orcidSearchUrl.js
=================
Javascript library that builds a search URL for the ORCID public API.
## Functions
* buildUrl(input) Takes a JSON object defining the search, and returns the URL to use in the API.
The input JSON object can have the following properties.
Property
Description
text
The text for a quick search across all fields. Can also be an ORCID iD, in which case only the iD field will be searched.
givenNames
Text to search across the given-names field.
searchOtherNames
Boolean to determine whether to search for givenNames in the other-names field. Default is false.
familyName
Text to search across the family-name field.
keyword
Text to search across the keyword field.
start
The row to start the results from (for paging). Default is 0 (the first row).
rows
The maximum number of results to return.
See orcidSearchUrlSpec.js for examples.
* setBaseUrl(url) Sets the base URL to use. The default is 'https://orcid.org/v1.1/search/orcid-bio/'.
* isValidInput(input) Returns true only if there is some input to search with.
* isValidOrcidId(orcidId) Returns true only if orcidId contains a valid looking ORCID iD URI or path.
Allows preceding and trailing whitespace.
## Using in a browser
Include orcidSearchUrl.js and call ``orcidSearchUrlJs.buildUrl({ text: 'my search terms'})``.
## Using in [Node.js](http://nodejs.org/)
1. Install
npm install orcid-search-url-js
2. Require the module
var orcidSearchUrl = require('orcid-search-url-js');
3. Call
orcidSearchUrlJs.buildUrl({ text: 'my search terms'});
## Contributing
Contributions are welcome.
Please make sure the unit tests (orcidSearchUrlSpec.js) reflect the changes and complete successfully.