Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
r = new XMLHttpRequest 'GET', '' + 'country=us&' + 'apiKey=******************************', true
r.responseType = 'json'
r.onreadystatechange = ->
if(r.status >= 400)
print "Error #{r.status}"
if(r.readyState == XMLHttpRequest.DONE && r.status == 200)
print r.response.articles[0].title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment