Last active
December 12, 2015 01:48
-
-
Save akre54/4693679 to your computer and use it in GitHub Desktop.
get all theaters moviepass works at in manhattan.
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
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