https://github.com/diging/crossref-connect
Connector to Crossref API
https://github.com/diging/crossref-connect
Last synced: 13 days ago
JSON representation
Connector to Crossref API
- Host: GitHub
- URL: https://github.com/diging/crossref-connect
- Owner: diging
- License: mpl-2.0
- Created: 2022-02-14T20:46:19.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2022-07-07T20:02:25.000Z (almost 4 years ago)
- Last Synced: 2025-01-11T07:13:11.794Z (over 1 year ago)
- Language: Java
- Size: 56.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Java Crossref Connector
This project provides a simple interface to query [Crossref's public API](https://api.crossref.org/swagger-ui/index.html).
## Installation
Using Maven, include the following plugin:
```xml
edu.asu.diging
crossref-connect
0.1
```
## Usage
Use the plugin as follows:
```java
CrossrefWorksService service = new CrossrefWorksServiceImpl(CrossrefConfiguration.getDefaultConfig());
try {
// search takes: query string, page size, and offset
List results = service.search("einstein", 5, 0);
// do something with the results
results.forEach(r -> System.out.println(r.getTitle()));
} catch (IOException e) {
// handle exception
e.printStackTrace();
} catch (RequestFailedException e) {
// handle exception
e.printStackTrace();
}
```
If for some reason, the default parameter to connect to Crossref need to be changed, customized `CrossrefConfiguration` can be used by either implementing a new `CrossrefConfiguration` class or adjusting the values in the `DefaultCrossrefConfiguration`.