add anti-patterns, print acc for ledger, fix chase 2021 from body.read double
This commit is contained in:
6
main.go
6
main.go
@@ -18,6 +18,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
patterns := regexp.MustCompile(config.AccountsPattern)
|
||||
antipatterns := regexp.MustCompile(config.AccountsAntiPattern)
|
||||
for email := range emails {
|
||||
transactions, err := Scrape(email, config.Banks)
|
||||
if err != nil {
|
||||
@@ -26,6 +27,11 @@ func main() {
|
||||
for _, transaction := range transactions {
|
||||
if !patterns.MatchString(transaction.Account) {
|
||||
log.Printf("skipping unmatching account pattern %q vs %q", config.AccountsPattern, transaction.Account)
|
||||
continue
|
||||
}
|
||||
if antipatterns.MatchString(transaction.Account) {
|
||||
log.Printf("skipping match account antipattern %q vs %q", config.AccountsAntiPattern, transaction.Account)
|
||||
continue
|
||||
}
|
||||
if _, err := config.Storage.Get(transaction.ID); err == nil {
|
||||
log.Println("skipping duplicate transaction:", transaction)
|
||||
|
||||
Reference in New Issue
Block a user