samjmck / ebay-monitor

Notifies you when new search results pop up in eBay
MIT License
26 stars 6 forks source link

Could not load configs: could not load .env: While parsing config: (2, 26): parsing error: no value can start with : #1

Open IroHaturo opened 2 years ago

IroHaturo commented 2 years ago

running ./ebay-monitor I get above error

copied your config and examples 1:1:

message = """
{{.Url}}
{{.Title}}
{{.Format}} with price {{.Price}} {{.Currency}} (postage {{.Postage}})
Condition {{.Condition}}
Seller has {{.SellerStars}} stars with a rating of {{.SellerFeedbackPercentage}}%
"""

web-server = false
track-scraped-urls = true

[[searches]]
url = "https://www.ebay.co.uk/sch/i.html?_from=R40&_nkw=duct+tape&_sacat=0&_sop=10"

[[searches]]
url = "https://www.ebay.co.uk/sch/i.html?_from=R40&_nkw=macbook+pro&_sacat=0&_sop=10"

Why isn't it working? :) Cheers

samjmck commented 2 years ago

Hi, this probably has to do with your configuration of your .env rather than your TOML. Make sure to put your TELEGRAM_TOKEN between " brackets, like so this: TELEGRAM_TOKEN="my_token"

IroHaturo commented 2 years ago

Cool! Thanks Sam, also for the very fast reply! :) Both TELEGRAM_CHAT_ID= and TELEGRAM_TOKEN= had no quotes (though I think I remember putting quotes, when entering the TELEGRAM_TOKEN= ...) TELEGRAM_CHAT_ID= was added automatically, as supposed, but with no quotes.

It starts now, but throws the following errors:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4037ec]

goroutine 1 [running]:
main.GetListing(0x13de480, 0x443, 0x0, 0x0, 0x0, 0x45c, 0x0, 0x0)
    /Users/sammckenzie/go/src/github.com/samjmckenzie/ebay-monitor/cmd/ebay-monitor/ebay.go:74 +0x48
main.startScraping.func1(0x0, 0x11876a0, 0x13a8150)
    /Users/sammckenzie/go/src/github.com/samjmckenzie/ebay-monitor/cmd/ebay-monitor/main.go:156 +0x330
github.com/PuerkitoBio/goquery.(*Selection).EachWithBreak(0x1187680, 0x1293f0c, 0xe)
    /Users/sammckenzie/go/src/github.com/PuerkitoBio/goquery/iteration.go:21 +0xe4
main.startScraping(0x100b7c0, 0x2, 0x2, 0x100b701, 0x1293f94, 0x0, 0x0)
    /Users/sammckenzie/go/src/github.com/samjmckenzie/ebay-monitor/cmd/ebay-monitor/main.go:118 +0x2a4
main.main()
    /Users/sammckenzie/go/src/github.com/samjmckenzie/ebay-monitor/cmd/ebay-monitor/main.go:209 +0x314
samjmck commented 2 years ago

I think this must have to do with eBay having changed the structure of their HTML since I last updated this project, but I can't be certain without looking at it. Unfortunately, I do not have time to fix this at the moment due to my studies. If you have any experience with Go, feel free to try and fix this bug.