5 ms·
Thanks mate. I wanted to build a no nonsense site and think I've achieved my goals for the time allotted for a weekend project. The architecture is dead simple
by maxwelldone 5y ago
Thanks mate. I wanted to build a no nonsense site and think I've achieved my goals for the time allotted for a weekend project.
The architecture is dead simple. Multiple times a week IMDb publishes bare bones datasets. I've a bash script to download them, format and load into MySQL from which I export two types of json files:
1) a file with all the TV shows names, id, ratings etc (shows.json) - this is what's used for search. It weighs 2MB compressed and I could certainly optimize but considering the low traffic I've stashed it for later time.
2) A file for every tv show with all the ratings and votes for its episodes. Based on your search, the specific file will be fetched to display ratings. This one file per show could also be optimized but looks premature at this stage.
You can see them here: https://github.com/dvnlgls/theshowgrid/tree/gh-pages/assets https://github.com/dvnlgls/theshowgrid/tree/gh-pages/assets
Strictly speaking, a database is also not necessary but it serves 2 purposes: 1) I could query easily to satisfy some curious show related questions. 2) The datasets include a ton of stale data (like shows w/o episodes and vice versa), so I find it easier to cleanup through SQL.