Codync
免費、開源的 1:1 替代方案,取代 Grok Bot 與 Muse。從 iPhone、Mac 或 Linux 桌面將 Claude Code、Codex、Cursor 與 40+ 程式碼代理人作為持續機器人傳訊。群組聊天、主題串…
AI 翻譯
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗This is a go package for working with the Crossref API. It is inspired by the an excellent CrossRefAPI Python package listed in the Crossref API docs. This package is meant to follow the "polite" guidelines for interacting with the public API at api.crossref.org.
appName := path.Base(os.Args[0])
client, err := crossrefapi.NewCrossRefClient(appName, "[email protected]")
if err != nil {
// handle error...
}
works, err := client.Works("10.1037/0003-066x.59.1.29")
if err != nil {
// handle error...
}
// continue processing your "works" result...
You can compare two copies of a "works" response and see what has changed.
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)
From v1.1.0 the package turns Crossref's marked-up titles and JATS abstracts
into text and HTML an institutional repository can use: tags removed,
subscripts and formulas converted, layout whitespace tidied, and abstracts as
HTML that Invenio RDM's sanitizer keeps, with formulas as TeX in \( ... \).
title, warnings := works.Message.FullTitle()
// Euclid preparation: CII. Non-Gaussianity of two-point statistics likelihood: ...
description, _ := works.Message.HTMLAbstract()
// <p>The extraction of cosmological information from two-point statistics ...</p>
others, _ := works.Message.AlternateTitles()
// the record's other titles, if it has any
crossrefapi.PlainText(s) and crossrefapi.HTMLAbstract(s) do the same for a
string. crossrefapi.NewNormalizer(path) makes a Normalizer that uses your own
override of the symbol table. Everything that cannot be converted cleanly comes
back as a warning, so a program can hand those records to a person. See
Text normalization for the rules, the warning codes and
the override file.
crossrefapi -mailto="[email protected]" works "10.1037/0003-066x.59.1.29"