apartment bot

Apartment Hunting with Azure – PART 2

House hunting in some cases is tiring and quite exhausting, but we still continue doing it because, at the end of the day, we still need a place to cater for our lives. In this project, I showcase an apartment bot I created to automatically apply for new vacancies – the bot can be extended to another real estate website for various use cases.

In my first post, I showcased the possibility of building a bot that can search for apartments and, in turn, send notifications to users so they can apply for it.

Aftermath

In the months following, the housing agency made several updates to its website, thus rendering the bot code unusable, which brought about a new quest for me to upgrade the bot again and, this time, explore another cloud provider. I mean I already knew AWS, so why not try out another cloud provider – Maybe Azure?

Azure looks tempting

After I published my first bot, I got a lot of interest in the bot’s work. One question people asked a lot back then was – Can it also apply to the apartments it found? Unfortunately, I always say NO that it couldn’t do that. So when I decided to make a new update to the bot, I decided this new bot will be fully autonomous i.e it will find apartments that matched the user’s criteria but also applied to them instantly.

That’s the real deal

So here ladies and gentlemen, this is the real deal…

Back to the technical stuff 🙂

Design Requirements

Before I started the project, I decided on one primary objective – the bot should be easy to run and work on most systems. One way to easier achieve that is through the delivery system. Instead of the initial microservices idea, I decided the whole bot should be packaged as a container making it easy for any to just run in their own environment. Other requirements regarding the cloud:

  • Be cloud-native
  • Be cloud agnostic

Approach

In order to achieve the above requirements, I decided the bot should be able to run as a container. If that is possible, the bot is automatically cloud-native and agnostic. The apartment bot is built around the Selenium framework which is usually utilized for UI testing, moving towards Selenium made it possible to interact with the new web application used by the website.

Azure Design

Since I decided I wanted to deploy my bot on the Azure platform, the following Azure services were utilized:

Azure Container Instances

A docker image is created for the bot and a container is deployed to Azure using ACI. ACI (Azure Container Instances) allows you to create and run your containers in Azure, supporting private and public registries.

Azure Logic Apps

Logic Apps is one of my favourite Azure services. Logic Apps allows you to create and run automated workflows. For example, you can decide to start and stop an application when an event occurs. For this apartment use case, although, logic app services are not a requirement, I added it as a way to reduce the cost of the container instance running the bot application.

Bot Logic App Workflow
So Why?

The apartments from the housing agency are generally released during a time of day. Usually from 16:00 every day, so instead of running the bot application always, I decided to use logic apps to launch the bot container three times a day – once in the morning, in the afternoon, and in the evening.

Result

After running the bots for several months, the design approach here works and it’s also scalable. Below are snapshots of the apartment hunting from the bot.

Here no apartments were found. Nothing happens
Here 1 apartment was found. The apartment has already been registered before. So no need to do anything else.

Code Usage

The project is uploaded to Github, where I explained how to run the bot in your own environment setup. The container images are uploaded to docker hub.

Conclusion

The idea of deciding to build a newer version of the apartment bot shows the possibilities of automation and how little effort (maybe not exactly little effort 🙂 ) we make can affect our lives positively and also open up new discoveries for us.

Ever since I started working with housing bots and saw how this could be used for other use cases like finding the perfect holiday home, or your next dream home, to me it’s a sixth sense. At some point, I wanted to use it for an auctioning website – imagine the extra leverage I will get with that.

One of the new discoveries I also embarked on was building a game bot – that’s a controversial one because of the ethics surrounding the usage and I will be writing about it shortly.

 

Share this post

Add comment

Privacy Preference Center