Skip to content

Instantly share code, notes, and snippets.

@SeidChr
Last active June 11, 2023 22:19
Show Gist options
  • Save SeidChr/baf0baf5a5e89611c291a9d9ddd33940 to your computer and use it in GitHub Desktop.
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.
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,
}
})))
@SeidChr
Copy link
Author

SeidChr commented Jun 11, 2023

date splitting and the split indices may have to be aligned with your local date format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment