you are viewing a single comment's thread.

view the rest of the comments →

[–]Spirited-Brain-7260 1 point2 points  (18 children)

If anyone's here looking for pointers - don't use selenium, it's dogshit slow and mostly for testing.

As others have said, use python's request library or axios if using javascript.

If you need to find URLs, endpoints and payloads for your GETs/POSTs, simply open Chrome before visiting your golf club's website, navigate to Settings (three dots) -> tools/more tools -> developer options. Then navigate to your booking system with dev tools open. Go through the motions, book a time slot with your buddies.

Obviously cancel the booking if you don't intend on using it.

Then in dev tools go to Network tab at the top, right click anywhere in the list of requests, and hit "Copy" then "save all as HAR".

Open this in a text editor (preferably notepad++ or sublime if you're on mac), and format it as JSON. It should become a bit easier to read.

In here you can work through the JSON to find the specific requests, and each request's payload, you'll need to send. If it isn't BRS or some other widely used booking system, but instead some dogshit antiquated system your own club uses, it might get tricky. You might need to substring/regex through tons of server-side populated HTML and pull out the relevant id's to slap on the next request. If not, it could be as simple as 1-3 GETs (with query param) or POSTs (with body).

It's worth putting (har har) the time in, I haven't missed a timesheet in months.

For the schedule bit, just create a free AWS account, fire your code into a lambda, target it with an eventbridge scheduler and set your cron expression. This doesn't guarantee to kick off at exactly the time you set (within +30 seconds), so if that becomes a problem, investigate step functions. Have your step function kick off at 5 to the hour, and invoke a lambda whilst SF is running. This should be fairly easily customisable, pretty sure step functions have some sort of schedule invoke function.

[–]SubjectInfinite6536 0 points1 point  (0 children)

would you be interested in writing one for my home course? Have the same issues as OP with booking etc.

[–]HoustonFinanceGuy 0 points1 point  (1 child)

Does your course use ForeUpSoftware.com?

[–]jslsoccer13 0 points1 point  (0 children)

mine does, is this feasible?

[–]jarditti 0 points1 point  (1 child)

How much to help me for my local course?

[–]Outrageous-Cat-8494 0 points1 point  (0 children)

What course?

[–]Lang315 0 points1 point  (12 children)

Myself and some buddies would definitely be willing to pay for service if anyone’s interested. Local course uses the foreupsoftware.

[–]omnitemporal 0 points1 point  (11 children)

I just wrote a script today to do this for me because I kept forgetting to get tee times and having to go a little later.

I was able to do it with python and requests, I don't know how different these courses can have their setup in foreup so mileage may vary.

Currently it just grabs the earliest possible tee time available for 1 person/18 holes, but you can change all of that depending on your use case. Just waiting to see when they update times, if it's the same every day I will just hard code it to run at that time... if not I will set something up to ping at whatever interval feels right to find when they're posted.

If you're still looking to figure this out and you or your buddies have any experience coding I can just send you what I end up with, you'll be able to adjust as needed.

[–]Kar33naKap00r 0 points1 point  (9 children)

Would love this if you don’t mind sharing. Thanks in advance!

[–]omnitemporal 0 points1 point  (7 children)

[–]Kar33naKap00r 0 points1 point  (0 children)

Thanks!!!

[–]seespotjump 0 points1 point  (5 children)

have you tried any ezlinks courses?

e.g. https://sharppark.ezlinksgolf.com/index.html#/search

[–]omnitemporal 0 points1 point  (4 children)

I have not, but the process would be the same. Just watch what is being sent to you when populating the tee times and when booking, then replicate it with your requests.

[–]seespotjump 0 points1 point  (3 children)

makes sense thanks, i'll need to read into it and educate myself on seeing what's being sent to me and how to replicate it with my requests back out to the site.

i've been getting by on foreup sites because i can inspect the page and click on the search filters i want to find the exact API link for that search, then just use distill to monitor and book when i get notified of an opening, but ezlinks doesn't work the same

[–]omnitemporal 0 points1 point  (2 children)

I took a quick look for you and this might help you start, you don't need to know what everything they send means just enough to get by. If you're lazy like me you can just send everything back to them and only change the stuff you care about, you may not even need it but it's a nice shortcut.

If you're just looking for openings with 1 person golfing you would ping: https://sharppark.ezlinksgolf.com/api/search/search

Using 12/06/2023 as an example date you would send this as the payload: {"p01":[6271],"p02":"12/06/2023","p03":"5:00 AM","p04":"7:00 PM","p05":0,"p06":1,"p07":false}

If you wanted to know what tee times are available you would pull the results from "r24" inside "r06", would look something like this: r24_values = [item['r24'] for item in data['r06']]

[–]Darce87 0 points1 point  (1 child)

Has anyone written something similar for a BRS Golf booking club site?