Created
May 11, 2013 17:28
-
-
Save mattes/5560714 to your computer and use it in GitHub Desktop.
read kippt user clips
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 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