Skip to content

Instantly share code, notes, and snippets.

@mattes
Created May 11, 2013 17:28
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 mattes/5560714 to your computer and use it in GitHub Desktop.
Save mattes/5560714 to your computer and use it in GitHub Desktop.
read kippt user clips
var getKipptReads = function(userId, callback) {
if(!userId) throw new Error('missing user id');
var query = 'use "store://OdRiZuDnzAn82XXFXFeQBg" as kippt.user.clips; select * FROM kippt.user.clips WHERE user_id="' + userId + '";';
$.getJSON('http://query.yahooapis.com/v1/public/yql?q=' + encodeURI(query + '&format=json&env=store://datatables.org/alltableswithkeys&callback=?'),
function(data){
if(data.query.count > 0) {
if(callback) return callback.call(null, data.query.results.json);
} else {
if(callback) return callback.call(null, false);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment