Created
February 12, 2018 16:30
-
-
Save deadlysyn/ac7c43bac2a67274a9b157ad4c5e2c95 to your computer and use it in GitHub Desktop.
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
function searchYelp(queryString, callback) { | |
let options = { | |
headers: {'Authorization': 'Bearer ' + APIKEY}, | |
hostname: APIHOST, | |
path: APIPREFIX + queryString, | |
port: 443 | |
} | |
https.get(options, function(res) { | |
res.setEncoding("utf8") | |
let body = "" | |
res.on("data", data => { | |
body += data | |
}) | |
res.on("end", () => { | |
callback(JSON.parse(body)) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment