Skip to content

Instantly share code, notes, and snippets.

@nazt
Created January 19, 2011 16:26
Show Gist options
  • Save nazt/786403 to your computer and use it in GitHub Desktop.
Save nazt/786403 to your computer and use it in GitHub Desktop.
query.share.fb.js
var qp1 = "select share_count from link_stat where url = '{0}'";
var q1 = FB.Data.query(qp1, 'http://www.together.in.th');
q1.wait(function(rows) {
console.log(rows);
FB.Array.forEach(rows, function(post) {
console.log(post,post.page_id, post.type );
});
})
FB.api('/147875075233045/insights', function(res) { FB.Array.forEach(res.data, function(k, stats) { console.log(stats, k, k.description, k.values[0].value, k.values[1].value, k.values[2].value) }) })
var qp1 = "select page_id,type from page_admin where uid = {0}";
var q1 = FB.Data.query(qp1,FB.getSession().uid);
q1.wait(function(rows) {
console.log(rows);
FB.Array.forEach(rows, function(post) {
console.log(post,post.page_id, post.type );
});
})
var qp1 = "select id,site,url,type from object_url where id='408808821969'";
var q1 = FB.Data.query(qp1);
q1.wait(function(rows) {
console.log(rows);
FB.Array.forEach(rows, function(post) {
console.log(post, post.message );
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment