Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32d09dbac6 | ||
|
|
e2cd24a39f |
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
type Job struct {
|
||||
ID string
|
||||
URI string
|
||||
Pickup JobLocation
|
||||
Dropoff JobLocation
|
||||
Weight int
|
||||
@@ -25,12 +26,13 @@ type JobLocation struct {
|
||||
|
||||
func (j Job) String() string {
|
||||
return fmt.Sprintf(
|
||||
`%s => %s (%d miles), Weight:%d, Notes:%s`,
|
||||
`%s => %s (%d miles), Weight:%d, Notes:%s Link:%s`,
|
||||
j.Pickup.String(),
|
||||
j.Dropoff.String(),
|
||||
j.Miles,
|
||||
j.Weight,
|
||||
j.Meta,
|
||||
j.URI,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -41,15 +43,10 @@ func (j JobLocation) String() string {
|
||||
func (j Job) FormatMultilineText() string {
|
||||
foo := func(client string) string {
|
||||
return fmt.Sprintf(
|
||||
"--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s",
|
||||
"--- %s: %s => %s ---",
|
||||
client,
|
||||
j.Pickup.State,
|
||||
j.Dropoff.State,
|
||||
j.Pickup.String(),
|
||||
j.Dropoff.String(),
|
||||
j.Weight,
|
||||
j.Miles,
|
||||
j.Meta,
|
||||
)
|
||||
}
|
||||
out := ""
|
||||
@@ -58,10 +55,22 @@ func (j Job) FormatMultilineText() string {
|
||||
log.Printf("job multiline: %+v contains %s then use %v", clients[k].States, j.Pickup.State, k)
|
||||
if strings.Contains(fmt.Sprint(clients[k].States), j.Pickup.State) {
|
||||
if len(out) > 0 {
|
||||
out += "\n\n"
|
||||
out += "\n"
|
||||
}
|
||||
out += foo(k)
|
||||
}
|
||||
}
|
||||
if len(out) > 0 {
|
||||
out = fmt.Sprintf(
|
||||
"%s\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s\n%s",
|
||||
out,
|
||||
j.Pickup.String(),
|
||||
j.Dropoff.String(),
|
||||
j.Weight,
|
||||
j.Miles,
|
||||
j.Meta,
|
||||
j.URI,
|
||||
)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ func (ntgJob ntgVisionJob) Job() Job {
|
||||
pickup, _ := time.ParseInLocation("01/02/06", ntgJob.PickupDate, time.Local)
|
||||
dropoff, _ := time.ParseInLocation("01/02/06", ntgJob.DropoffDate, time.Local)
|
||||
return Job{
|
||||
ID: fmt.Sprintf("ntg-%d", ntgJob.ID),
|
||||
ID: fmt.Sprintf("ntg-%d", ntgJob.ID),
|
||||
URI: fmt.Sprintf(config.Get().Brokers.NTG.LoadPageURIFormat, ntgJob.ID),
|
||||
Pickup: JobLocation{
|
||||
Date: pickup,
|
||||
City: ntgJob.PickupCity,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"DirectionsURIFormat": "https://maps.googleapis.com/maps/api/directions/json?origin=%s\u0026destination=%s\u0026mode=driving\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg",
|
||||
"PathedURIFormat": "https://maps.googleapis.com/maps/api/staticmap?size=250x250\u0026path=%s\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg\u0026size=250x250\u0026markers=%s|%s\u0026zoom=5",
|
||||
"URIFormat": "https://maps.googleapis.com/maps/api/staticmap?center=%s\u0026markers=label=A|%s\u0026zoom=5\u0026size=250x250\u0026scale=1\u0026format=jpeg\u0026maptype=roadmap\u0026key=AIzaSyBkACm-LQkoSfsTO5_XAzBVZE9-JQzcNkg",
|
||||
"Pathed": true,
|
||||
"Pathed": false,
|
||||
"Pickup": false,
|
||||
"Dropoff": false
|
||||
},
|
||||
@@ -61,7 +61,7 @@
|
||||
"Matrix": {
|
||||
"ReceiveEnabled": true,
|
||||
"Mock": false,
|
||||
"Continuation": "602",
|
||||
"Continuation": "1318",
|
||||
"Homeserver": "https://m.bltrucks.top",
|
||||
"Username": "@bot.m.bltrucks.top",
|
||||
"Token": "mvDWB96KXMF8XhOam8EC5XVdQvSEw0CDeClcSWocBcYkwZX3FPNWZ5uOnQk2EmT1cjpzfeuD7gDYPPjOuyZlI3bE9TE35UjNOlZgi0Tugm25s91iVsbIF6kMZsCIhVMSmEf6w3jxX6wQYOWvmDZ4mu6f5c8wr221EMDcOpEzQV09d1zuBSWgKLBgjqAkYHJZ5dTRIWpEDpPgujhOFZa2ld1HiAOxrJKlIrlfDBN0CUsTlGOGplujDAr4VtpFzNRS",
|
||||
@@ -73,6 +73,7 @@
|
||||
"Brokers": {
|
||||
"NTG": {
|
||||
"Mock": true,
|
||||
"LoadPageURIFormat": "https://ntgvision.com/LoadDetails?loadId=%d",
|
||||
"Token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIzMTAyOSIsInVuaXF1ZV9uYW1lIjoibm9lYXN5cnVuc3RydWNraW5nQGdtYWlsLmNvbSIsImp0aSI6IjFmYzhmNjk1LTQzNTYtNGYzZS05NWY1LWZkNWVjMDJlMDkxNyIsImlhdCI6IjEvMTAvMjAyMiAxMTo1OTozNiBQTSIsIm50Z3ZSb2xlIjoiQ2FycmllckFwcHJvdmVkIiwidXNlckNhcnJpZXJzIjoiMTUzNDIzIiwib3RyVXNlciI6IkZhbHNlIiwibmJmIjoxNjQxODU5MTc2LCJleHAiOjE2NDE5NDE5NzYsImlzcyI6Ik5URyBTZWN1cml0eSBUb2tlbiBTZXJ2aWNlIiwiYXVkIjoiTlRHIn0.kpHOBTtcQhbdloAw7xEjnkzfxf4ToMgidrLCMomZmnmKQHlD_7OQuI8nQiCTHc_ntuGtt8Ui92kwWWUiLwN_2tT2vC7Jy6m9IjwqgbAzsgTLi4jAbIwITD-awiDh4FUKDwGq3XpEjs-i7XM3rI7tTk7jg9QSDId8EF3Pt5fJq6QhztC6y7-JaSFQZLMtkSCAWmOQx_TgKgVoVbgMeiqhHbZ2hhoA7TtpEIIL5Gnfq46t3E18ExdrsO96ZCGQGcBw5x8J1ustq2cwdlFKeg4ULNWAAd1ay1hojRa7jCHs98AcoJ3Nts9-o7yEMuN2rrfpK_nm68nciwFtF-ke1KoiBg",
|
||||
"Username": "noeasyrunstrucking@gmail.com",
|
||||
"Password": "thumper123"
|
||||
|
||||
@@ -51,10 +51,11 @@ type Config struct {
|
||||
Once bool
|
||||
Brokers struct {
|
||||
NTG struct {
|
||||
Mock bool
|
||||
Token string
|
||||
Username string
|
||||
Password string
|
||||
Mock bool
|
||||
LoadPageURIFormat string
|
||||
Token string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
todo:
|
||||
- write-as for clients so ma can write to pa by default
|
||||
- link to view more
|
||||
- continuation is garbo, but I can still do better client side to avoid get-set high level
|
||||
- todo: details from ntg; stophours for pickup, appointmenttime/facitlyhours for dest
|
||||
details: |
|
||||
@@ -22,6 +21,7 @@ todo:
|
||||
- banlist criteria like vendors, brokers, metadata
|
||||
- set up copy for caleb, broc
|
||||
done:
|
||||
- link to view more
|
||||
- map with to-from line
|
||||
- TO CONFLUENT.RS OR W/E
|
||||
- rm get-set stuff for matrix now that it has continuation
|
||||
|
||||
Reference in New Issue
Block a user