diff --git a/broker/ntgvision.go b/broker/ntgvision.go index edca617..720f1c0 100644 --- a/broker/ntgvision.go +++ b/broker/ntgvision.go @@ -114,7 +114,7 @@ func (ntg NTGVision) newRequest(states []config.State) (*http.Request, error) { "MaxNumberOfStopsLimit": nil, "MaxWeightLimit": nil, "MinMilesLimit": nil, - "SavedSearchId": nil, ///2956, + "SavedSearchId": 2956, }) if err != nil { return nil, err @@ -128,7 +128,7 @@ func (ntg NTGVision) newRequest(states []config.State) (*http.Request, error) { request.Header.Set("Accept-Language", "en-US,en;q=0.5") request.Header.Set("Accept-Encoding", "gzip, deflate, br") request.Header.Set("Content-Type", "application/json;charset=utf-8") - request.Header.Set("Authorization", strings.Split(strings.Split(config.Get().Brokers.NTG.Cookie, "; NTGAuthToken=")[1], "; ")[0]) + request.Header.Set("Authorization", "Bearer "+strings.Split(strings.Split(config.Get().Brokers.NTG.Cookie, "; NTGAuthToken=")[1], "; ")[0]) request.Header.Set("Origin", "https://ntgvision.com") request.Header.Set("DNT", "1") request.Header.Set("Connection", "keep-alive") diff --git a/config.json b/config.json index 0ceaf2e..c3de510 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,11 @@ { "Interval": "1s", - "States": ["NC"], - "Once": true + "States": ["OH", "CA"], + "Once": true, + "Brokers": { + "NTG": { + "Mock": true, + "Cookie": "" + } + } } diff --git a/config/config.go b/config/config.go index 07e0e90..b844af2 100644 --- a/config/config.go +++ b/config/config.go @@ -15,6 +15,7 @@ type Config struct { Once bool Brokers struct { NTG struct { + Mock bool Cookie string } } diff --git a/main.go b/main.go index 0b81c1e..16ed5ae 100644 --- a/main.go +++ b/main.go @@ -56,7 +56,11 @@ func once() error { func getJobs() ([]broker.Job, error) { states := config.Get().States - brokers := []broker.Broker{broker.NewNTGVision().WithMock()} + ntg := broker.NewNTGVision() + if config.Get().Brokers.NTG.Mock { + ntg = ntg.WithMock() + } + brokers := []broker.Broker{ntg} jobs := []broker.Job{} for _, broker := range brokers { somejobs, err := broker.Search(states)