diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-03-30 02:38:42 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-03-30 02:38:42 +0200 |
commit | a7381838fa51e4ad62d76b8b5a013047969718a8 (patch) | |
tree | ab0ff6e9d81cdf9f8b5b1e4b21d89caf45239a0c /skate/cmd | |
parent | 1fa58a706f655c98b468fb006462d2a54d1d286d (diff) | |
download | refcat-a7381838fa51e4ad62d76b8b5a013047969718a8.tar.gz refcat-a7381838fa51e4ad62d76b8b5a013047969718a8.zip |
generete a doi list
Diffstat (limited to 'skate/cmd')
-rw-r--r-- | skate/cmd/skate-biblioref-from-wikipedia/main.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/skate/cmd/skate-biblioref-from-wikipedia/main.go b/skate/cmd/skate-biblioref-from-wikipedia/main.go index 61b590e..86fba1a 100644 --- a/skate/cmd/skate-biblioref-from-wikipedia/main.go +++ b/skate/cmd/skate-biblioref-from-wikipedia/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "log" "os" "runtime" @@ -25,12 +26,13 @@ func main() { if err := json.Unmarshal(p, &w); err != nil { return nil, err } - b, err := json.Marshal(w.ParseIDList()) - if err != nil { - return nil, err + idl := w.ParseIDList() + if idl.DOI == "" { + return nil, nil } - b = append(b, bytesNewline...) - return b, nil + s := fmt.Sprintf("%s\t%s\n", idl.DOI, string(p)) + return []byte(s), nil + }) pp.NumWorkers = *numWorkers pp.BatchSize = *batchSize |