Add isbn parser

This commit is contained in:
Las Zenow 2015-02-08 00:16:29 -05:00
parent 09536bd0d8
commit 2f2ff3dd8f
3 changed files with 112 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import (
"regexp"
"strings"
"git.gitorious.org/go-pkg/epubgo.git"
"github.com/meskio/epubgo"
)
type MetaData map[string]interface{}
@ -33,7 +33,10 @@ func EpubMetadata(epub *epubgo.Epub) MetaData {
attr, _ := epub.MetadataAttr(m)
for i, d := range data {
if attr[i]["scheme"] == "ISBN" {
metadata["isbn"] = d
isbn := ISBN(d)
if isbn != "" {
metadata["isbn"] = isbn
}
}
}
default: