Last active
March 23, 2017 13:46
-
-
Save waterjump/ea8e289b394002ffe8665faebb812506 to your computer and use it in GitHub Desktop.
Recursive AJAX call to facebook
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
myp = new p5 # http://p5js.org/reference/ | |
App = {} | |
App.setupPlayer = (json) -> | |
# do stuff | |
window.test = -> | |
myp.httpGet( | |
'https://graph.facebook.com/v2.8/me?fields=live_videos.limit(1)%7Bstatus%2Ccomments%7D&access_token=XXXXXXXXXXXXXXXXXXX', | |
{}, | |
'json', | |
( (json) -> | |
App.setupPlayer(json) | |
return | |
) | |
) | |
setTimeout(test, 5000); | |
return | |
test() |
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
var App, myp; | |
myp = new p5; | |
App = {}; | |
App.setupPlayer = function(json) { | |
// do stuff | |
}; | |
window.test = function() { | |
myp.httpGet( | |
'https://graph.facebook.com/v2.8/me?fields=live_videos.limit(1)%7Bstatus%2Ccomments%7D&access_token=XXXXXXXXXXXXXXXXXXX', | |
{}, | |
'json', | |
( | |
function(json) { | |
App.setupPlayer(json); | |
} | |
) | |
); | |
setTimeout(test, 5000); | |
}; | |
test(); | |
// --- | |
// generated by coffee-script 1.9.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment