# Netflix watched videos "DB" - viable?

**URL:** <https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788>\
**Category:** Help\
**Created:** [December 7, 2021, 10:41pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788 "2021-12-07T22:41:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [December 7, 2021, 10:41pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/1 "2021-12-07T22:41:38Z")

</div>

People,

I can export my Netflix watched videos from their site to a CSV file and massage it so it has this format:

```auto
Title: Archer: Season 1: Pilot: Mole Hunt (Episode 1) {{{1
Date: 2016-12-28
Time: 08:23:13
Duration: 00:21:34

Title: Archer: Season 1: Training Day (Episode 2) {{{1
Date: 2016-12-28
Time: 08:45:00
Duration: 00:21:21

etc

```

This is so I can conveniently work with the file using Vim and Voom which allows me to do everything I want to do - but I need a way of displaying the records in a little web site so friends and relatives can look at the info too.

So I am thinking it could work like this:

1. I recreate the file periodically as normal after watching a batch of movies

2. I use a Jekyll app to import the file so it can be displayed as one long table on the app’s home page.

3. I have the title for each record linked to a post in \_posts/ in the normal way to display the plot and my notes.

This might seem a bit clunkey but I don’t want to have to use SQLite etc in a Rails app . .

What do you think?

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [December 7, 2021, 10:52pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/2 "2021-12-07T22:52:07Z")

</div>

Hmm . . now that I think about it a bit more - maybe the home page shoud have a list of years that are links to shorter tables . . and maybe I should just keep single line record CSV file with ‘|’ field separators . .

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [December 8, 2021, 1:31am UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/3 "2021-12-08T01:31:15Z")

</div>

You can take the csv and put it into the `/_data` folder (or create it in the root folder).

After that, you can create a page (or pages) that display the information. Jekyll supports CVS, xml, json, yaml and other formats.

Here is a quick video that shows how to do it:

[Working with Jekyll Data, Part 3: Custom Data](https://youtu.be/kKU-lMv5OZM)

[![](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/0/0f3638ad095a50c603656af414a13b7715fba1b0.jpeg "Working with Jekyll Data, Part 3: Custom Data") ](https://www.youtube.com/watch?v=kKU-lMv5OZM)

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [December 8, 2021, 7:29am UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/4 "2021-12-08T07:29:56Z")

</div>

If you can get the data into CSV, JSON, or YAML format, you can put it in `_data` directory as covered above

Then iterate over the data with Jekyll.

I wrote a tutorial on the docs on turning data in a CSV into a table.

> **[Tabulate CSV Data](https://jekyllrb.com/tutorials/csv-to-table/)**
>
> This tutorial shows how to use Jekyll to read a CSV and render the data as an HTML table.

For storage, you could manually dump the data from Netflix and then commit and push it.

Or you can have that automated to run say daily or weekly with GH Actions. That can either commit a file in the repo. or can build the site and update the data file without committing it but using it in the build.

I have a Jekyll project which runs daily to get data from GH API via a plugin i made and then builds the site using data on `site` object. So each repo becomes a “card” on the page but this could easily be a table.

> **[GitHub - MichaelCurrin/my-github-projects: Dev portfolio static site showing...](https://github.com/MichaelCurrin/my-github-projects)**
>
> Dev portfolio static site showing a user's Github repos grouped by topic - GitHub - MichaelCurrin/my-github-projects: Dev portfolio static site showing a user's Github repos grouped by topic

I am thinking of rebuilding this site to use a separate step of outputting JSON file and then reading it with Jekyll, to make it easier to debug and also then my plugin in Ruby can be replaced with a Python script which I’d prefer.

Also considering moving away from MoustacheJS for the form input filtering and use Vue instead.

* * *

If you are into Vue or React, you could easily set up a one page site that pulls in data from a JSON file that you commit.

It makes templating easy - you pass in your data from a JSON path or a JS object and with a loop it gets turned into HTML, much like Jekyll but not static.

Especially good if you want to do any interactivity like sorting or filtering based a form input.

I have an site here using data from GH API as a one page Vue site with no build step. Served with GH Pages.

[https://michaelcurrin.github.io/gist-viewer/](https://michaelcurrin.github.io/gist-viewer/)

You could replace the call to GH API with a request to `/assets/shows.json`. I do that here in a plain HTML site with CSV data

> **[GitHub - MichaelCurrin/network-graphs: The easy way to visualize CSV data as...](https://github.com/MichaelCurrin/network-graphs)**
>
> The easy way to visualize CSV data as a network graph - GitHub - MichaelCurrin/network-graphs: The easy way to visualize CSV data as a network graph

And that JSON file can be the one you generated from Netflix data. Manually or with a scheduled task that commits the updates to the repo and rebuilds.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [December 8, 2021, 7:36am UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/5 "2021-12-08T07:36:29Z")

</div>

One other thing. Netflix doesn’t have a public API anymore but I found another site which uses Netflix and other providers as data.

I have a basic site that requests data from the API using Netlify Function and renders JSON results on the page including images.

Thus uses mustache for templating. If you don’t know Vue or React, mustache might be easier for you to get into to just make a table or list using a JS template. The mustache docs will help you there.

> **[GitHub - MichaelCurrin/netflix-assistant: Search and filter shows and movies...](https://github.com/MichaelCurrin/netflix-assistant)**
>
> Search and filter shows and movies on Netflix using the reelgood.com API - GitHub - MichaelCurrin/netflix-assistant: Search and filter shows and movies on Netflix using the reelgood.com API

> <https://github.com/MichaelCurrin/netflix-assistant/blob/c329a4c06b29b894b7927c22b4498377777a154c/index.html#L39>

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [December 8, 2021, 1:05pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/6 "2021-12-08T13:05:25Z")

</div>

Bill, Michael.

Thanks for all that stuff! - I am looking at it all now - I think it should work!

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [December 8, 2021, 10:26pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/7 "2021-12-08T22:26:47Z")

</div>

People,

OK, I have something working that is quite nice I think - I now have 6 years of viewing (2016-2021) in 6 different CVS files that produce 6 different tables.

The next step is to do some scripting that will help minimise manual creation of posts. From my previous little txt file and then Rails exercises, I have records that I could process into posts - all good! However, it would be really nice if a row in a table happens to have a corresponding post associated with that video, that when the CVS files are being processed, a link could be added to the title field.

So, currently my table production code looks like this:

```auto
---
layout: default
---

<table>
  {% for row in site.data.y2021 %}
    {% if forloop.first %}
    <tr>
      {% for pair in row %}
        <th>{{ pair[0] }}</th>
      {% endfor %}
    </tr>
    {% endif %}

    {% tablerow pair in row %}
      {{ pair[1] }}
    {% endtablerow %}
  {% endfor %}
</table>

```

I presume it is going to be possible to add an “if” statement to check if an appropriate post exists for that video, and, if it does, add the correct ink to the title field when the table is being created?

Thanks again - love Jekyll !

Phil.

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [December 8, 2021, 10:48pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/8 "2021-12-08T22:48:28Z")

</div>

Cool. Yes, you can nest an `if` statement in there no problem.

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [January 7, 2022, 11:43am UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/9 "2022-01-07T11:43:59Z")

</div>

People,

Is there some way of using pipe separated values instead of commas in the \_data files? eg

Year | Name | Age  
1952 | Phil | 70  
1955 | Alan | 66

- I couldn’t get it to work . .

Thanks,  
Phil.

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [January 10, 2022, 5:29pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/10 "2022-01-10T17:29:41Z")

</div>

You cannot no. However if you can use tab-separated, Jekyll supports that. Ideally you put it in YAML or JSON format, but comma and tab separated are supported

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [January 11, 2022, 7:19am UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/11 "2022-01-11T07:19:54Z")

</div>

Thought that might be the case - thanks for the confirmation!

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [January 11, 2022, 1:07pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/12 "2022-01-11T13:07:51Z")

</div>

> [@BillRaymond](#):
>
> comma and tab separated are supported

Hmm - they both work fine on my local machine but on GitLab only CSV works - I guess I should I tell someone there is a problem . .

---

<div class="post-metadata">

**Author:** ![BillRaymond](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/billraymond/32/5963_2.png) [@BillRaymond](https://talk.jekyllrb.com/u/BillRaymond)\
**Post date:** [January 11, 2022, 5:44pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/13 "2022-01-11T17:44:08Z")

</div>

That’s very odd. Does gitlab allow you to do a custom build ala GitHub Actions? That could resolve the problem.

---

<div class="post-metadata">

**Author:** ![philiprhoades](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/philiprhoades/32/1755_2.png) [@philiprhoades](https://talk.jekyllrb.com/u/philiprhoades)\
**Post date:** [January 11, 2022, 9:26pm UTC](https://talk.jekyllrb.com/t/netflix-watched-videos-db-viable/6788/14 "2022-01-11T21:26:35Z")

</div>

> [@BillRaymond](#):
>
> GitHub Actions

I don’t know what that is - I will check it out . .

Thanks.
