Okay, so today I wanna talk about this little side project I’ve been messing with called “orlovsky food tweet.” It’s nothing crazy, just a fun way to automatically tweet out food-related stuff from around Orlovsky. Let me walk you through how I got it all set up.

The Idea Spark
It all started when I was trying to figure out what to eat. I was kinda bored with the usual spots. Thought it would be cool to have a bot that just scours local restaurants’ websites or social media for daily specials, new menu items, or anything food-related and throws it up on Twitter. Purely for my own lazy convenience, really.
Digging for Data
- First, I needed to find the data. I started by making a list of all the restaurants in Orlovsky that had some kind of online presence.
- Then, I spent a couple of days just manually checking their websites, Facebook pages, Instagram accounts, whatever I could find. I was looking for patterns, seeing how they typically announced their specials or new stuff.
- This was the most tedious part, honestly. Lots of scrolling, lots of copy-pasting.
Building the Scraper (the Fun Part!)
I decided to use Python for this. Figured it would be the easiest way to scrape the web and then interact with the Twitter API.
- I used
Beautiful Soup
to parse the HTML of the websites. It’s pretty straightforward for pulling out specific elements, like the text in a certaindiv
or the image source from animg
tag. - For the social media stuff, I used the respective APIs (like the Facebook Graph API and the Instagram API). These were a bit trickier to set up, needed to get API keys and all that jazz. But once I had them, it was pretty easy to pull data.
- I wrote different scraper functions for each restaurant, since they all had different website structures. This was a bit of a pain to maintain, but it worked.
Tweeting it Out
- Next up was getting the data onto Twitter. I used the
tweepy
library for this. It’s a Python wrapper around the Twitter API, makes it super easy to send tweets. - I set up a Twitter developer account and got my API keys. This part is kinda annoying, you gotta jump through some hoops to get approved.
- Then, I wrote a function that takes the scraped food info and formats it into a tweet. I tried to keep the tweets short and sweet, with a link back to the restaurant’s website or social media page.
Automating the Whole Thing
I wanted this to run automatically, so I didn’t have to manually trigger it every day.
- I set up a cron job on my server to run the Python script every morning at 10 AM. That way, it would tweet out the day’s specials right around lunchtime.
- I also added some error handling to the script, so if something went wrong (like a website was down or the Twitter API was acting up), it would log the error and try again later.
The Result
And that’s pretty much it! Now, every day at 10 AM, my “orlovsky food tweet” bot automatically tweets out food-related stuff from around town. It’s been fun to see it in action, and I’ve actually discovered some new places to eat because of it.
What I Learned
This project was a good reminder that sometimes the most useful tools are the ones you build for yourself. It wasn’t a super complicated project, but it scratched an itch I had, and I learned a bunch along the way. Plus, now I never have to wonder where to get lunch.