Created
February 8, 2019 00:32
-
-
Save stilist/29972baf66ec8addefeb3f746e5a16d5 to your computer and use it in GitHub Desktop.
Export Netflix ratings as JSON
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
// You can run this from your browser's JavaScript console. | |
console.log(JSON.stringify(Array.from(document.querySelectorAll('.retableRow')).map(node => { | |
let rating | |
const stars = node.querySelectorAll('.rating .personal') | |
if (stars.length) { | |
rating = stars.length | |
} else { | |
rating = node.querySelector('.rated-up') ? 'up' : 'down' | |
} | |
const linkNode = node.querySelector('.title a') | |
return { | |
date: new Date(node.querySelector('.date').textContent).toISOString(), | |
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
hey, its a little outdated. ive updated it to work with the thumbs ratings
https://gist.github.com/SeidChr/baf0baf5a5e89611c291a9d9ddd33940