mdesilva / AmazonFlexUnlimited

Automate the process of grabbing job blocks from Amazon Flex
170 stars 102 forks source link

Get desiredWarehouses #140

Open GasStationNet opened 1 year ago

GasStationNet commented 1 year ago

How to display desiredWarehouses names instead id in sms alert?

ArmandoA88 commented 1 year ago

to display warehouse names I implemented a map, it should look something like this in FlexUnlimited.py

WAREHOUSE_MAP = { "bbcf923a-f0f5-42c9-8db5-6346b3a7e1f4": "Carrollton TX - (VTX2) - Sub Same-Day", "dae2f1d7-b83c-407b-824a-54f6ec8d4590": "Dallas TX (VTX3) - Sub Same-Day", "0d066983-f097-439c-a976-35f3212c82f1": "Richardson TX (VTX8) - Sub Same-Day", "90bf1bf6-f573-4468-a369-8df88b05a238": "Lewisville (DDF1)- Amazon.com", "7fab79e9-e17e-41fb-806a-9fc652e71a5c": "Town East Mall (PTCM) - Retail Delivery", "85be4004-1992-4dc2-acd9-90ab62fbcf74": "Southlake Town Square (PSIP) - Retail Delivery", "66c6781d-a24f-4606-a43d-55cbd7eb0dac": "DFW Vickery Meadow (C004) - Whole Foods", "f21db56c-113f-426a-8721-4e34acffdb3a": "Fort Worth (UTX7) - Fresh Online", "2f090261-6c18-447a-b66a-fbb25623b5c3": "McKinney (DDX2)- Amazon.com", "31315709-b1fb-46d3-859e-e03555080d79": "Fort Worth (DDF5) - Amazon.com", "87c3e9e8-87d9-4117-861b-a53fb5402994": "Dallas Fairview (C134) - Whole Foods", "f865632e-4e85-4631-ba56-4ffa345f3a21": "Northpark Center (PNAC) - Retail Delivery", "92cd2d15-e13c-4bbf-b766-cae514542f84": "Firewheel Town Center (PFAP) - Retail Delivery", "8a676392-4d60-49dc-bbfb-e671ed3cb726": "DFW Colleyville (C230) - Whole Foods", "3f597c76-849c-4243-94df-9c48b4d8524a": "Galleria Dallas (PGAA) - Retail Delivery", "4a564148-d643-4061-a2e5-91d2ac8097e3": "Fort Worth Waterside (C132) - Whole Foods", "3351a845-44e5-44b0-85f2-c2bb1069eb91": "DFW Highland Village (C234) - Whole Foods", "6e412759-09ef-4314-92d9-c05ae1b73a50": "Dallas (DDA8)-Amazon.com", "b24c0648-c9cb-4d36-8ba9-6fd9a617bc0d": "Mansfield (DDF4) - Amazon.com", "96c0482a-93ae-4692-8e50-f536a59e7940": "University Park Village (PUAV) - Retail Delivery", "1321de1d-8b3d-4614-937f-0b8cde4fc686": "Fort Worth (DDA9)- Amazon.com", "f6552228-b5db-4bc1-bd01-2d6030c96123": "Grapevine Mills (PGAP) - Retail Delivery", "d05f217a-96bf-4abd-81a2-d83f493f5885": "Frisco (DDX6)-Amazon.com", "c373d7c2-3f5c-48db-8a5b-46a065ead9ad": "DFW Las Colinas (C005) - Whole Foods", "68d691aa-5ba6-4ea9-9b9d-76ad3556cc48": "Forney (DDX7)- Amazon.com", "4d90d07a-d5ec-48bf-bc84-bb533ea56fbd": "Balch Springs (DDF2)- Amazon.com", "e0d11a03-9fef-4534-9f2c-3dfdb89e6f39": "Irving Mall (PIAG) - Retail Delivery", "66ff8f42-2ec2-4b45-a396-ae7c6b663044": "Hudson Oaks (RDA2) - Community Delivery", "04443175-3b02-492d-82eb-ea93c6f07983": "Van Horn Drive In Dallas (PVBV) - Retail Delivery", "bd53075f-455c-4884-ac36-29aa359a113c": "Park Village (PPBE) - Retail Delivery", "1e878843-9180-4c72-8bd3-4ba628bfc4b2": "Hulen Mall (PHAA) - Retail Delivery", "fc07134e-d16c-4c6c-852e-4d6e03435d9a": "Golden Triangle Mall (PGAN) - Retail Delivery", "c0bb4909-7371-4275-9e60-aa9d35406949": "Parks at Arlington (PPAC) - Retail Delivery", "d03e68ce-6b92-475c-b504-ed22283db724": "Grand Prairie (DHX5)- Amazon.com", "d7dd9e79-98b2-4e26-a483-fa9a443cace7": "Fort Worth (DDF6) - Amazon.com", "27996521-4158-4298-9019-d03eca903a20": "Preston Royal Shopping (PPAU) - Retail Delivery", "d8d6f0ae-b5fb-409f-9c01-aefa745a473a": "Stonebriar Centre (PSAF) - Retail Delivery", "db11d9bb-3697-4a61-9e9c-5b3573758d1e": "Linwood (RDA1) - Community Delivery", "8": "Dallas (UTX4) - Fresh Online", "600944d0-4d18-42b0-a0d8-45cd52c4caeb": "North East Mall (PNAD) - Retail Delivery" }

#add this code on def __acceptOffer if request.status_code == 200: self.__acceptedOffers.append(offer) # Fetch warehouse name from the map warehouse_name = WAREHOUSE_MAP.get(offer.location, offer.location) # Default to offer.location if not found in the map message = f"Successfully accepted an offer. Warehouse ID: {warehouse_name}, Start Time: {offer.startTime}, End Time: {offer.endTime}, Blockrate: {offer.ratePerHour} per hour" Log.ntfy(message, self) # Send notification using the new message format

that's for ntfy.sh notifications should now look something like this... 8/19/23, 12:41 PM Successfully accepted an offer. Warehouse ID: Dallas TX (VTX3) - Sub Same-Day, Start Time: 2023-08-19 13:45:00, End Time: 2023-08-19 17:45:00, Blockrate: 28.0 per hour

asadbek064 commented 12 months ago

I have that feature implemented however you have to manually enter the address and id in the config. However I am using discord web hooks and Twilio API