Skip to content

Instantly share code, notes, and snippets.

@derrikengel
Created March 26, 2020 15:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derrikengel/3de82ec123d8c86bf34f09e1887a9772 to your computer and use it in GitHub Desktop.
Save derrikengel/3de82ec123d8c86bf34f09e1887a9772 to your computer and use it in GitHub Desktop.
Generate a list of your Movies Anywhere Screen Pass eligible movies.
// How to use:
// 1) Go to https://moviesanywhere.com/collection/my-screen-pass-eligible-movies in Google Chrome
// 2) Images are lazy-loaded, so you'll have to manually scroll to the very bottom of your list for all movies to load
// 3) Open Dev Tools Console (Ctrl+Shift+J / Cmd+Opt+J)
// 4) Paste this script and hit enter. It will prompt you to save a text file of your eligible Screen Pass movies.
// find all images in the main section that have an alt attribute (Title)
var images = document.querySelectorAll('main img[alt]');
var data = '';
// loop through the images
images.forEach(img => {
// ignore the "Sale" images
if (img.alt != 'Sale') {
// store the title and a line break
data += img.alt + '\n';
}
});
// create a hidden link to generate the download
var link = document.createElement('a');
link.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(data);
link.target = '_blank';
link.download = 'screen-pass.txt';
link.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment