Hey Siri, what's the Flavor of the Day? (Apple Shortcuts and Culver's API)
I decided to mix a little computer nerdery with my family’s love of ice cream.
I created an Apple Shortcut that grabs your current location, finds the three closest Culver’s, and shows their Flavor of the Day.
Cut to the chase—the Shortcut can be downloaded here.
The secret sauce behind this is the Culver’s API. Hats off to Joe Steinbring, who first brought it to my attention. Earlier versions of this Shortcut scraped the webpage of my local Culver’s, but this is much cleaner.
How it works
- Decide how many local Culver’s to return (
radius = 3). - Get current location.
- Save
latitudeandlongitudefrom Current Location into separate variables. - Fetch the Culver’s API using those values:
http://www.culvers.com/api/locator/getlocations?lat=[Latitude]&long=[Longitude]&limit=[radius] - Convert the response into a dictionary.
- Loop through each item; the key you want is
metadata.flavorOfDayName.
By default, the radius is set to 3, so it returns the three closest Culver’s to your GPS coordinates. Change the radius variable if you want more (or fewer) results.
And since it’s a Shortcut, you can just ask Siri, “What’s the Flavor of the Day?”
This was a fun little project, and I’ll admit—it gets used multiple times a week in our house.
If you try it out, I’d love to hear what you think!