Skip to content

Instantly share code, notes, and snippets.

@akre54
Last active December 12, 2015 01:48
Show Gist options
  • Save akre54/4693679 to your computer and use it in GitHub Desktop.
Save akre54/4693679 to your computer and use it in GitHub Desktop.
get all theaters moviepass works at in manhattan.
var allTheaters = [];
var nycZips = [
// Greenpoint
11211, 11222,
// Bushwick & Williamsburg
11206, 11221, 11237,
// Greenwich Village & Soho
10012, 10013, 10014,
// Lower Manhattan
10004, 10005, 10006, 10007, 10038, 10280,
// Lower East Side
10002, 10003, 10009,
// Northeast Queens
11361, 11362, 11363, 11364
];
nycZips.forEach(function(zip, index) {
$.getJSON('https://www.moviepass.com/theaters/nearby.json?utf8=%E2%9C%93&zipcode=' + zip + '&distance=2',
function(response) {
var theaterNames = _.pluck(response.theaters, 'name');
allTheaters = _.uniq(allTheaters.concat(theaterNames));
if (index === nycZips.length - 1) {
console.log(allTheaters, allTheaters.length);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment