Skip to content

Instantly share code, notes, and snippets.

@leemartin
Created April 5, 2012 23:26
Show Gist options
  • Save leemartin/2315016 to your computer and use it in GitHub Desktop.
Save leemartin/2315016 to your computer and use it in GitHub Desktop.
OnTimedComments Example
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