Skip to content

Instantly share code, notes, and snippets.

@johntynan
Forked from leemartin/ontimedcomments.js
Created April 14, 2012 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johntynan/2382965 to your computer and use it in GitHub Desktop.
Save johntynan/2382965 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