Last active
June 11, 2023 22:19
-
-
Save SeidChr/baf0baf5a5e89611c291a9d9ddd33940 to your computer and use it in GitHub Desktop.
Script can export netflix thumbs-ratings as json when pasted in a browser console on the https://www.netflix.com/viewingactivity tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(JSON.stringify(Array.from(document.querySelectorAll('.retableRow')).map(node => { | |
let rating | |
const up1 = node.querySelectorAll('[data-name="RateUpFill"]') | |
const up2 = node.querySelectorAll('[data-name="RateTwoThumbsFill"]') | |
// const down = node.querySelectorAll('[data-name="RateDownFill"]') | |
if (up1.length) { | |
rating = 1 | |
} else { | |
if (up2.length) { | |
rating = 2 | |
} else { | |
rating = -1 | |
} | |
} | |
const linkNode = node.querySelector('.title a') | |
const textDateSplit = node.querySelector('.date').textContent.split('.') | |
const day = textDateSplit[0] | |
const month = textDateSplit[1] | |
const year = textDateSplit[2] | |
const date = new Date('20' + year, month - 1, day, 0, 0, 0, 0) | |
return { | |
date: date, | |
title: linkNode.textContent, | |
link: linkNode.href, | |
rating, | |
} | |
}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
date splitting and the split indices may have to be aligned with your local date format.