Created
September 6, 2014 19:44
-
-
Save csbuja/5a6906fa49bfa7ce8a02 to your computer and use it in GitHub Desktop.
moveThroughYelp
This file contains 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
function moveThroughYelp(data, type){ | |
var setOfInfo = [] | |
for(var i = 0; i< data.businesses.length; ++i){ | |
var info = {} | |
if (!data.businesses[i].is_closed || (type === 'food' && data.businesses[i].rating<2 ) ) continue; | |
info.rating = data.businesses[i].rating; | |
info.rating_img_url_small= data.businesses[i].rating_img_url_small; | |
info.rating_img_url_large = data.businesses[i].rating_img_url_large; | |
info.rating_img_url = data.businesses[i].rating_img_url; | |
info.address = data.businesses[i].location.address + ' ' + data.businesses[i].location.city + ', ' + data.businesses[i].location.state_code + ' ' +data.businesses[i].location.postal_code | |
info.name = data.businesses[i].name; | |
setOfInfo.push(info); | |
} | |
return setOfInfo; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment