Created
April 5, 2012 23:26
-
-
Save leemartin/2315016 to your computer and use it in GitHub Desktop.
OnTimedComments Example
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
SC.initialize({ | |
client_id: "YOUR_CLIENT_ID" | |
}); | |
SC.whenStreamingReady(function() { | |
SC.stream(TRACK_ID, { | |
ontimedcomments: function(comments) { | |
var comment, _i, _len; | |
for (_i = 0, _len = comments.length; _i < _len; _i++) { | |
comment = comments[_i]; | |
$.getJSON("http://api.embed.ly/1/oembed?callback=?", { | |
key: EMBEDLY_KEY, | |
url: comment.body | |
}, function(data) { | |
// Now do something awesome with the data embed.ly returns. ;-) | |
}); | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment