diff --git a/Dockerfile b/Dockerfile index 7c53c621d..3ef89ecc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.6 +FROM alpine:edge LABEL maintainer="dev@jpillora.com" # prepare go env ENV GOPATH /go diff --git a/vendor/github.com/jpillora/scraper/scraper/endpoint.go b/vendor/github.com/jpillora/scraper/scraper/endpoint.go index f57720546..4a6717a75 100644 --- a/vendor/github.com/jpillora/scraper/scraper/endpoint.go +++ b/vendor/github.com/jpillora/scraper/scraper/endpoint.go @@ -101,7 +101,7 @@ func (e *Endpoint) Execute(params map[string]string) ([]Result, error) { } }) } else { - results[0] = e.extract(sel) + results = append(results, e.extract(sel)) } return results, nil } diff --git a/vendor/github.com/jpillora/scraper/scraper/handler.go b/vendor/github.com/jpillora/scraper/scraper/handler.go index f2140a1f3..c12de0327 100644 --- a/vendor/github.com/jpillora/scraper/scraper/handler.go +++ b/vendor/github.com/jpillora/scraper/scraper/handler.go @@ -132,7 +132,13 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { enc := json.NewEncoder(w) enc.SetEscapeHTML(false) enc.SetIndent("", " ") - if err := enc.Encode(res); err != nil { + var v interface{} + if endpoint.List == "" && len(res) == 1 { + v = res[0] + } else { + v = res + } + if err := enc.Encode(v); err != nil { w.Write([]byte("JSON Error: " + err.Error())) } }