This PR implements a new api: /next-holiday which returns the Topic's contents corresponding to the next holiday on the Jewish calendar. It utilizes the HebCal API. It asks from the HebCal API for the next 3 months of holidays and iterates over them looking for the first one that we have a Topic for. HebCal API does not return holidays in our exact spellings, so in order to identify the corresponding topic get_name_completions is called with each result from HebCal. Then, the code iterates over the results from get_name_completions looking for a Topic, and when it finds it, it returns the Topic's contents.
The PR also modifies /api/calendars slightly. This adds the Parashat HaShavua's corresponding topic slug to the /api/calendars results so that the Sheets HomePage has an easy way to create the link to the Parashat HaShavua's topic page.
This PR implements a new api: /next-holiday which returns the Topic's contents corresponding to the next holiday on the Jewish calendar. It utilizes the HebCal API. It asks from the HebCal API for the next 3 months of holidays and iterates over them looking for the first one that we have a Topic for. HebCal API does not return holidays in our exact spellings, so in order to identify the corresponding topic
get_name_completions
is called with each result from HebCal. Then, the code iterates over the results fromget_name_completions
looking for a Topic, and when it finds it, it returns the Topic's contents.The PR also modifies /api/calendars slightly. This adds the Parashat HaShavua's corresponding topic slug to the /api/calendars results so that the Sheets HomePage has an easy way to create the link to the Parashat HaShavua's topic page.