Skip to content

Instantly share code, notes, and snippets.

@ipwnponies
Last active September 24, 2022 05:02
Show Gist options
  • Save ipwnponies/ac6dfe66054dec9129bb329101ef3d66 to your computer and use it in GitHub Desktop.
Save ipwnponies/ac6dfe66054dec9129bb329101ef3d66 to your computer and use it in GitHub Desktop.
House of prime rib reservation
for day_offset in (seq 0 0)
for hour in (seq 16 22)
set open_table_url 'https://www.opentable.com/restref/api/availability?lang=en-US'
set session_token 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvdGNmcCI6IjQ0MTM2ZmEzNTViMzY3OGExMTQ2YWQxNmY3ZTg2NDllOTRmYjRmYzIxZmU3N2U4MzEwYzA2MGY2MWNhYWZmOGEiLCJpYXQiOjE2NjM4MTAwODAsImV4cCI6MTY2MzgyMDg4MH0.boXS_p4VyIuAGinPb3-DCwBmUIazcckOQnm4itzgAQw'
set house_prime_rib_id 1779
set timestamp ( date -d"2022-11-30 +$day_offset days +$hour hour")
curl $open_table_url -s -X POST -H 'Content-Type: application/json' -H $session_token --data-raw (printf '{"rid":%s,"dateTime":"%s","partySize":2,"enableFutureAvailability":true,"transformOutdoorToDefault":false}' $house_prime_rib_id $timestamp) | \
jq --color-output --sort-keys '.availability |to_entries[] | [.key, .value.timeSlots]'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment