The chutney bot
There are a few places in the San Francisco bay area where you can have a south Indian delicacy called Masala Dose. There’s only a single place where you can have the best version of it; at Suryadarshini dosa truck.
So much is the craving for this dose, there were often long lines resulting in a wait time of a few hours! COVID hit & now you can no longer drop by & order just like any other food truck. You will need to place an order a couple of days in advance & usually sells out within a few minutes.
Suryadarshini is a family-run business & they are located at the Bishop Ranch farmer’s market every Saturday between 10:00 AM to 02:00 PM.
Tempted? So, how do I order & keep my taste buds happy? Here you go,
- There are a limited number of dose’s available to order every week
- The demand is so high (yes!!!!! even for dose’s) that a couple of days in advance, they open up an ordering system that lets you preorder the dose’s
- Being a veteran dose hunter, I’ve been noticing that they consistently sell out within the first 1–2 minutes of opening. 120 seconds is all that’s available between you & a crispy masala dose
- Now, if you are still reading & really want the benne/butter masala dose, butterfingers won’t help! Keep a reminder for Thursday, 07:00 PM & bookmark Suryadarshini’s home page
- When it’s time, login, find & tap the “I Accept” hyperlink as fast as you can. The link is posted exactly at 07:00 PM & changes every week; welcome to silicon valley!
- Select the dose, the count & make the payment
- If you have managed to complete these above steps in < 120 seconds, then “mission accomplished!”
- You get a pickup time emailed to you on the Friday & you can go pick up your order on Saturday
- Repeat next {week, month, year}
For fun, what if we automate some of the above steps? Here’s how, we’ll write a script to,
- remind us on Thursday (ping on WhatsApp)
- get the dynamic link from Suryadarshini’s website
- post it to WhatsApp
- place order (not sharing the logic for this to be fair)
We’ll use cron to schedule & pass args to the script to express our emotions :)
$ crontab -l# Minute | Hour | Day | Month | Day of the week | Command00 17 * * THU /usr/local/bin/python3 /opt/get_dose.py --wait
30 18 * * THU /usr/local/bin/python3 /opt/get_dose.py --cant-wait
59 18 * * THU /usr/local/bin/python3 /opt/get_dose.py --lets-do-it
Here’s the sequence of events:
- T minus 90 min (05:30 PM, Thursday): Send a reminder
- T minus 30 min (06:30 PM, Thursday): Send another reminder
- T minus 01 min (06:59 PM, Thursday): Watch for link & post when found
Now we’ve automated STEP1–5. Click on the “Direct URL” link, which should take you to STEP6 & continue from there. Here’s the source code & happy eating!!