Created
June 11, 2012 23:30
-
-
Save jrm2k6/2913409 to your computer and use it in GitHub Desktop.
xhr request coffeescript
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
(exports ? this).get_pictures_from_tags = () -> | |
url_img = [] | |
for tag in tags | |
url_img.push(get_pictures_from_tag tag) | |
console.log url_img | |
return | |
get_pictures_from_tag = (elem) -> | |
req = new XMLHttpRequest() | |
req.addEventListener 'readystatechange', -> | |
if req.readyState = 4 | |
if (req.status = 200) or (req.status = 304) | |
data = eval req.responseText | |
console.log 'data message '+req.responseType | |
else | |
console.log 'error' | |
req.open 'GET', "https://api.instagram.com/v1/tags/test/media/recent?client_id=3edf56917c57450f8602173dad5f01dd", true | |
req.send null | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment