-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
654 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,4 @@ dataset.egg-info | |
py/test_* | ||
idxdefs/* | ||
*.bak | ||
*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it as below." | ||
title: crossrefapi | ||
type: software | ||
title: "crossrefapi" | ||
abstract: "A Golang package and command line tool for working with the | ||
public CrossRef API" | ||
authors: | ||
- family-names: Doiel | ||
given-names: Robert | ||
orcid: https://orcid.org/0000-0003-0900-6903 | ||
abstract: A Golang package and command line tool for working with the public CrossRef API | ||
orcid: "https://orcid.org/0000-0003-0900-6903" | ||
|
||
maintainers: | ||
- family-names: Doiel | ||
given-names: Robert | ||
orcid: "https://orcid.org/0000-0003-0900-6903" | ||
|
||
repository-code: "https://github.com/caltechlibrary/crossrefapi" | ||
type: software | ||
version: 1.0.1-pre | ||
version: 1.0.1 | ||
license-url: "https://caltechlibrary/crossrefapi/LICENSE" | ||
keywords: | ||
- CrossRef | ||
- DOI | ||
- GitHub | ||
- metadata | ||
date-released: 2022-07-27 | ||
keywords: [ "CrossRef", "DOI", "metadata" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,36 @@ with the public API at api.crossref.org. | |
// continue processing your "works" result... | ||
``` | ||
|
||
You can compare two copies of a "works" response and see what has changed. | ||
|
||
```go | ||
|
||
appName := path.Base(os.Args[0]) | ||
client, err := crossrefapi.NewCrossRefClient(appName, "[email protected]") | ||
if err != nil { | ||
// handle error... | ||
} | ||
newWorks, err := client.Works("10.1037/0003-066x.59.1.29") | ||
if err != nil { | ||
// handle error... | ||
} | ||
// Fetch our previously saved works document. | ||
src, err := os.ReadFile("0003-066x.59.1.29.json") | ||
if err != nil { | ||
// handle error... | ||
} | ||
oldWorks := new(crossrefapi.Works) | ||
if err := json.Unmarshal(src, &oldWorks); err != nil { | ||
// handle error... | ||
} | ||
src, err = oldWorks.DiffAsJSON(newWorks) | ||
if err != nil { | ||
// handle error... | ||
} | ||
fmt.Println("Diff for 10.1037/0003-066x.59.1.29") | ||
fmt.Printf("\n%s\n", src) | ||
``` | ||
|
||
## Command line example | ||
|
||
``` | ||
|
@@ -30,6 +60,6 @@ with the public API at api.crossref.org. | |
|
||
## Reference | ||
|
||
+ [CrossRef API Docs](https://github.com/CrossRef/rest-api-doc) | ||
+ [CrossRef Schemas](https://www.crossref.org/schema/) | ||
+ [CrossRefAPI](https://github.com/fabiobatalha/crossrefapi) - Python implementation | ||
- [CrossRef API Docs](https://github.com/CrossRef/rest-api-doc) | ||
- [CrossRef Schemas](https://api.crossref.org/swagger-ui/index.html) | ||
- [CrossRefAPI](https://github.com/fabiobatalha/crossrefapi) - Python implementation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.