Browse Source

Fixed last data point for prices

master
Patrick Gaskin 2 years ago
parent
commit
2104fc3f45
Signed by: geek1011 GPG Key ID: A2FD79F68A2AB707
  1. 4
      README.md
  2. 1
      graph/graph.go

4
README.md

@ -1,4 +1,6 @@
# camelparse
camelparse parses historical Amazon price data from camelcamelcamel. It parses
the price graph images quite accurately (no issues when tested with ~4 years of
data from B01N5IB20Q and B0167AK9Y8).
data from B01N5IB20Q and B0167AK9Y8).
TODO: unit tests, see git history for data

1
graph/graph.go

@ -76,6 +76,7 @@ func Parse(img image.Image, maxPrice, minPrice float64, startDate, endDate time.
curPrice, curStock = price, inStock
changes = append(changes, PriceChange{inStock, date, price})
})
changes = append(changes, PriceChange{changes[len(changes)-1].InStock, endDate, changes[len(changes)-1].Price})
return changes, err
}