Netflix does not warn users when their content leaves the platform. As a result, sometimes we search on Netflix for a show that we wanted to watch and, uh oh! It's not available anymore 😬.
We wanted to fix this. The original idea pitched was to access the movies and TV shows on each user's Netflix 'My List' and import them directly to Outflix dashboard. Our app would then cross the titles on that list with an API that would have information on its expiring dates. Finally, we would notify users whenever a title from their 'My List' is about to expire.
We set out to explore how to accomplish this. Unfortunately, Netflix closed its public API in 2014 and, without it, 1) we'd have no access the user's 'My List' and 2) no access to each title's expiring date.
So we changed the product a bit. We designed a dashboard of every expiring title, grouped by week, for a user's country. Users would be able to filter titles by type (movie or TV show), rating and genre. Then, instead of notifying Ouflix users of expiring titles from a tailored list, we would notify the users of all the expiring titles for their country.
Displaying expiring titles became possible because we found an unofficial API (Unogs) that lists all expiring titles per country. With this sorted, the next challenge was to find the best approach to parse and accommodate the API call results.
Because this is a paid API we didn't want to be calling the API every time users would go see their dashboards. We decided to create a service that calls the API and caches both the query and the result as jsonb on a dedicated table. Then we added another service that fetches all the details that we wanted to extract - such as title, genre, rating, expiring date - and store it on a Content table.
This design allowed us to replace API calls by fetching content from the database. This also helped with faster loading times, which in turn resulted in providing a better UX.
During this time we were constantly deploying the app to Heroku to stay on top of any issues that might pop up. Of course, there were many ocasions where the code failed in production... But it worked on our machines! 🤯
Next up we dealt with the notification system, which was our core value. We decided to set up notifications via email or SMS with a weekly or monthly schedule. To do this, we used Rails mailers and integrated with Twilio for SMS delivery.
To send the notifications periodically and to update the database weekly, we set up rake tasks. Then, with the help of Heroku scheduler, we set up jobs on Heroku to run the rake tasks every day. The rake tasks evaluate the day of the week and, if it is Monday, the tasks are executed!