Skip to content

Instantly share code, notes, and snippets.

@deadlysyn
Created February 12, 2018 16:30
Show Gist options
  • Save deadlysyn/ac7c43bac2a67274a9b157ad4c5e2c95 to your computer and use it in GitHub Desktop.
Save deadlysyn/ac7c43bac2a67274a9b157ad4c5e2c95 to your computer and use it in GitHub Desktop.
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