diff --git a/webActions.go b/webActions.go index 9d16754..162c213 100644 --- a/webActions.go +++ b/webActions.go @@ -168,6 +168,25 @@ func DownloadPricelists(client *http.Client) error { return nil } +// DownloadBnnlists - Download both price lists. The lists are public so we do not necessarily login before downloading. +func DownloadBnnlists(client *http.Client) error { + // Download PL.BNN + r, err := client.Get("https://static.paxan.de/2016/PL.BNN") + if err != nil { + return err + } + downloadFile(("PL-" + time.Now().Format("20060102150405") + ".BNN"), r) + + // Download PLF.BNN + r, err = client.Get("https://static.paxan.de/2016/PLF.BNN") + if err != nil { + return err + } + downloadFile(("PLF-" + time.Now().Format("20060102150405") + ".BNN"), r) + + return nil +} + // RetrievePricelist - Downloads and converts pricelist into an array func RetrievePricelist(client *http.Client) ([]SpricelistEntry, error) { // Download spreisliste