
@rlesser
Get Favorites on Resy
This function fetches your favorite restaurants and venues, as specified in your Hit List.
Inputs
An object
containing:
authToken
- Your authentication token, normally generated from @rlesser.Resy_authenticate.
Returns
A Favorites
object, containing the ids of your favorite venues, defined in the type below.
See other Resy vals I've made.
Get a Venue's Calendar on Resy
This function fetches the calendar for a given venue on Resy, which gives information on which days the venue is available, sold-out, or closed.
Inputs
An object
containing:
venue_id
- The Resy venue id, either fetched from the website's network data or from @rlesser_getFavorites (Todo: add venue id from url function).num_seats
- The number of seats you are checking for availability for. Use 2 as a default if you just want to know when the restaurant is closed.
Returns
A VenueCalendar
object, containing:
last_calendar_day
- A string representing the last day the restaurant has made their calendar available for (normally a few weeks out from today).scheduled
- An object containing a list of dates and restaurant statuses. See type below.
See other Resy vals I've made.
Authenticate with Resy
This function can be used to generate an authentication token for Resy, which can be used to view favorites, set notifies, or even make reservations.
Inputs
An AuthParams
object containing:
email
- The email address for your Resy account. Probably best to keep private.password
- The password for your Resy account. Definitely keep this private, and place it in a secret.
Returns
An AuthResponse
object containing:
id
- Your Resy account id.token
- Your Resy account token, used to authenticate you in subsequent API calls.
See other Resy vals I've made.
getNextSSR - fetch data from Next.js SSR-based sites
Many modern websites use Next.js and Server-side Rendering (SSR) to serve their website and the data to populate it. Instead of standard API calls, this manifests in the browser as calls routed through dynamic endpoints.
This val handles the url construction and response parsing, giving you access to the endpoint and data.
Input
- websiteUrl - The website's url, like
google.com
orval.town
let getNextSSR: (websiteUrl: string) => Promise<(endpoint: string) => Promise<Record<string, any>>>
Returns
- fetching function - A function that takes in an endpoint and returns the endpoint's response data:
-
- Input
-
- endpoint - The endpoint string, like
results.json
ortrending.json?page=2
- endpoint - The endpoint string, like
-
- Returns
-
- data - The endpoint response data, without NextJS artifacts.
Example
const fetch = await @rlesser.getNextSSR("example.com");
const data = fetch("results.json");
return data;