I did something useless

— by Hugo Mechiche

— 17/12/2020

Earlier this year, I applied to 42 Paris which is a computer science college. To apply to 42 you first need to fill out information about you then you have to pass two tests from their website. The first test is 15min long and it tests your memory, the second one is 2hours long and tests your logic. If you pass these tests you will receive an email which basically says "Congratulations you pass the first step". Indeed they say first step because the second selection step is what they call La Piscine (which means the swimming pool in english). La Piscine is one month full-time at school where you must work approximately 14hours a day every day of the week.

So, right now I am at the step where I must choose one of the proposed dates to go to the Piscine. Every dates were full for 2020 so I was waiting for dates of 2021 and I thought that they were going to send me an email when they open a date... but two days ago when I went to 42's website I saw that the two first Piscines of 2021 were already full so I was a bit lost that I didn't receive an email. So I told myself that I wasn't going to miss another date but I didn't want to check every single day the website (I'm a bit lazy haha). Therefore I decided to create a Python script to automate this boring task.

I had never done a web scrapper before but I knew it wasn't going to be too complicated. I thought that the worst part would be to log into the website to see the Piscines dates. So yesterday I checked on the internet how to do it and it turned out that the whole thing was very simple. But I wanted to receive a damn email and i struggled with which method was going to work but after 30mins I figured it out.

The Python script was ready but not automated. Since I'm on Linux I'm going to use cron. With cron I can tell my computer to execute a task every x minutes. Now every hour and a half the script was going to be executed and would sent me an email if there were a new date.

2 hours ago, at the time of this writing, I checked the 42's website in details and saw that they had some social networks. I clicked on their instagram link and... They made a post to indicate which day and at what time the three next dates were going to open. Here's a whole idea that will have been useless hahaha.

You can check the code right here.